Fossil SCM
Merge updates from trunk.
Commit
5ea6a95a7b1dddb9dbd9ab656a6398d434dcbef6
Parent
591bc4434b4bf70…
56 files changed
+1
-1
+2
+240
-331
+154
-103
+19
-2
+8
-8
+55
+1
-1
+1
-1
+16
-5
+1
-1
+1
+3
+3
+5
+3
-8
+1
-1
+1
-1
+5
-5
+2
-2
+2
-2
+2
-2
+16
-16
+3
-3
+1
-1
+1
-1
+7
-6
+1
+32
-31
+2
-1
+3
-3
+3
-3
+8
-4
+8
-4
+52
+505
-237
+3
-3
+13
-2
+42
-43
+42
-43
+2
-2
+2
-2
+166
-154
+4
-4
+36
-3
+1
-1
+1
-1
+1
+1
+1
+29
-30
+12
-3
+15
-15
+8
-8
+1
-1
+7
-7
~
Makefile.in
~
auto.def
~
autosetup/config.guess
~
autosetup/config.sub
~
src/allrepo.c
~
src/attach.c
~
src/blob.c
~
src/branch.c
~
src/browse.c
~
src/checkin.c
~
src/checkout.c
~
src/clone.c
~
src/comformat.c
~
src/comformat.c
~
src/config.h
~
src/db.c
~
src/descendants.c
~
src/descendants.c
~
src/diff.c
~
src/finfo.c
~
src/finfo.c
~
src/http_socket.c
~
src/http_ssl.c
~
src/http_transport.c
~
src/info.c
~
src/info.c
~
src/main.c
~
src/makemake.tcl
~
src/manifest.c
~
src/mkindex.c
~
src/name.c
~
src/name.c
~
src/printf.c
~
src/printf.c
~
src/shell.c
~
src/sqlite3.c
~
src/sqlite3.h
~
src/stat.c
~
src/timeline.c
~
src/timeline.c
~
src/tkt.c
~
src/tkt.c
~
src/unicode.c
~
test/graph-test-1.wiki
~
test/merge_renames.test
~
win/Makefile.PellesCGMake
~
win/Makefile.dmc
~
win/Makefile.mingw
~
win/Makefile.mingw.mistachkin
~
win/Makefile.msc
~
www/branching.wiki
~
www/changes.wiki
~
www/fossil-v-git.wiki
~
www/password.wiki
~
www/shunning.wiki
~
www/tickets.wiki
+1
-1
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | # care about testing the end result, this can be blank. |
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | -TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H | |
| 42 | +TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H | |
| 43 | 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | 45 | |
| 46 | 46 | include $(SRCDIR)/main.mk |
| 47 | 47 | |
| 48 | 48 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -37,11 +37,11 @@ | |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H |
| 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | |
| 46 | include $(SRCDIR)/main.mk |
| 47 | |
| 48 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -37,11 +37,11 @@ | |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | |
| 46 | include $(SRCDIR)/main.mk |
| 47 | |
| 48 |
M
auto.def
+2
| --- auto.def | ||
| +++ auto.def | ||
| @@ -261,10 +261,12 @@ | ||
| 261 | 261 | if {[string match *mingw* [get-define host]]} { |
| 262 | 262 | define-append LIBS -lwsock32 |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | cc-check-function-in-lib iconv iconv |
| 266 | +cc-check-functions utime | |
| 267 | +cc-check-functions usleep | |
| 266 | 268 | |
| 267 | 269 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 268 | 270 | if {![cc-check-functions getloadavg]} { |
| 269 | 271 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 270 | 272 | msg-result "Load average support unavailable" |
| 271 | 273 |
| --- auto.def | |
| +++ auto.def | |
| @@ -261,10 +261,12 @@ | |
| 261 | if {[string match *mingw* [get-define host]]} { |
| 262 | define-append LIBS -lwsock32 |
| 263 | } |
| 264 | } |
| 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 |
| --- auto.def | |
| +++ auto.def | |
| @@ -261,10 +261,12 @@ | |
| 261 | if {[string match *mingw* [get-define host]]} { |
| 262 | define-append LIBS -lwsock32 |
| 263 | } |
| 264 | } |
| 265 | cc-check-function-in-lib iconv iconv |
| 266 | cc-check-functions utime |
| 267 | cc-check-functions usleep |
| 268 | |
| 269 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 270 | if {![cc-check-functions getloadavg]} { |
| 271 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 272 | msg-result "Load average support unavailable" |
| 273 |
+240
-331
| --- autosetup/config.guess | ||
| +++ autosetup/config.guess | ||
| @@ -1,44 +1,38 @@ | ||
| 1 | 1 | #! /bin/sh |
| 2 | 2 | # Attempt to guess a canonical system name. |
| 3 | -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | |
| 4 | -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | |
| 5 | -# Free Software Foundation, Inc. | |
| 3 | +# Copyright 1992-2014 Free Software Foundation, Inc. | |
| 6 | 4 | |
| 7 | -timestamp='2010-09-24' | |
| 5 | +timestamp='2014-03-23' | |
| 8 | 6 | |
| 9 | 7 | # This file is free software; you can redistribute it and/or modify it |
| 10 | 8 | # under the terms of the GNU General Public License as published by |
| 11 | -# the Free Software Foundation; either version 2 of the License, or | |
| 9 | +# the Free Software Foundation; either version 3 of the License, or | |
| 12 | 10 | # (at your option) any later version. |
| 13 | 11 | # |
| 14 | 12 | # This program is distributed in the hope that it will be useful, but |
| 15 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | 15 | # General Public License for more details. |
| 18 | 16 | # |
| 19 | 17 | # You should have received a copy of the GNU General Public License |
| 20 | -# along with this program; if not, write to the Free Software | |
| 21 | -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA | |
| 22 | -# 02110-1301, USA. | |
| 18 | +# along with this program; if not, see <http://www.gnu.org/licenses/>. | |
| 23 | 19 | # |
| 24 | 20 | # As a special exception to the GNU General Public License, if you |
| 25 | 21 | # distribute this file as part of a program that contains a |
| 26 | 22 | # configuration script generated by Autoconf, you may include it under |
| 27 | -# the same distribution terms that you use for the rest of that program. | |
| 28 | - | |
| 29 | - | |
| 30 | -# Originally written by Per Bothner. Please send patches (context | |
| 31 | -# diff format) to <[email protected]> and include a ChangeLog | |
| 32 | -# entry. | |
| 33 | -# | |
| 34 | -# This script attempts to guess a canonical system name similar to | |
| 35 | -# config.sub. If it succeeds, it prints the system name on stdout, and | |
| 36 | -# exits with 0. Otherwise, it exits with 1. | |
| 23 | +# the same distribution terms that you use for the rest of that | |
| 24 | +# program. This Exception is an additional permission under section 7 | |
| 25 | +# of the GNU General Public License, version 3 ("GPLv3"). | |
| 26 | +# | |
| 27 | +# Originally written by Per Bothner. | |
| 37 | 28 | # |
| 38 | 29 | # You can get the latest version of this script from: |
| 39 | 30 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
| 31 | +# | |
| 32 | +# Please send patches with a ChangeLog entry to [email protected]. | |
| 33 | + | |
| 40 | 34 | |
| 41 | 35 | me=`echo "$0" | sed -e 's,.*/,,'` |
| 42 | 36 | |
| 43 | 37 | usage="\ |
| 44 | 38 | Usage: $0 [OPTION] |
| @@ -54,13 +48,11 @@ | ||
| 54 | 48 | |
| 55 | 49 | version="\ |
| 56 | 50 | GNU config.guess ($timestamp) |
| 57 | 51 | |
| 58 | 52 | Originally written by Per Bothner. |
| 59 | -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | |
| 60 | -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free | |
| 61 | -Software Foundation, Inc. | |
| 53 | +Copyright 1992-2014 Free Software Foundation, Inc. | |
| 62 | 54 | |
| 63 | 55 | This is free software; see the source for copying conditions. There is NO |
| 64 | 56 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 65 | 57 | |
| 66 | 58 | help=" |
| @@ -90,11 +82,11 @@ | ||
| 90 | 82 | if test $# != 0; then |
| 91 | 83 | echo "$me: too many arguments$help" >&2 |
| 92 | 84 | exit 1 |
| 93 | 85 | fi |
| 94 | 86 | |
| 95 | -trap 'exit 1' HUP INT TERM | |
| 87 | +trap 'exit 1' 1 2 15 | |
| 96 | 88 | |
| 97 | 89 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
| 98 | 90 | # compiler to aid in system detection is discouraged as it requires |
| 99 | 91 | # temporary files to be created and, as you can see below, it is a |
| 100 | 92 | # headache to deal with in a portable fashion. |
| @@ -104,11 +96,11 @@ | ||
| 104 | 96 | |
| 105 | 97 | # Portable tmp directory creation inspired by the Autoconf team. |
| 106 | 98 | |
| 107 | 99 | set_cc_for_build=' |
| 108 | 100 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
| 109 | -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; | |
| 101 | +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; | |
| 110 | 102 | : ${TMPDIR=/tmp} ; |
| 111 | 103 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 112 | 104 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 113 | 105 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
| 114 | 106 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
| @@ -137,17 +129,38 @@ | ||
| 137 | 129 | |
| 138 | 130 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
| 139 | 131 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
| 140 | 132 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
| 141 | 133 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
| 134 | + | |
| 135 | +case "${UNAME_SYSTEM}" in | |
| 136 | +Linux|GNU|GNU/*) | |
| 137 | + # If the system lacks a compiler, then just pick glibc. | |
| 138 | + # We could probably try harder. | |
| 139 | + LIBC=gnu | |
| 140 | + | |
| 141 | + eval $set_cc_for_build | |
| 142 | + cat <<-EOF > $dummy.c | |
| 143 | + #include <features.h> | |
| 144 | + #if defined(__UCLIBC__) | |
| 145 | + LIBC=uclibc | |
| 146 | + #elif defined(__dietlibc__) | |
| 147 | + LIBC=dietlibc | |
| 148 | + #else | |
| 149 | + LIBC=gnu | |
| 150 | + #endif | |
| 151 | + EOF | |
| 152 | + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` | |
| 153 | + ;; | |
| 154 | +esac | |
| 142 | 155 | |
| 143 | 156 | # Note: order is significant - the case branches are not exclusive. |
| 144 | 157 | |
| 145 | 158 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
| 146 | 159 | *:NetBSD:*:*) |
| 147 | 160 | # NetBSD (nbsd) targets should (where applicable) match one or |
| 148 | - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, | |
| 161 | + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, | |
| 149 | 162 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
| 150 | 163 | # switched to ELF, *-*-netbsd* would select the old |
| 151 | 164 | # object file format. This provides both forward |
| 152 | 165 | # compatibility and a consistent mechanism for selecting the |
| 153 | 166 | # object file format. |
| @@ -179,11 +192,11 @@ | ||
| 179 | 192 | else |
| 180 | 193 | os=netbsdelf |
| 181 | 194 | fi |
| 182 | 195 | ;; |
| 183 | 196 | *) |
| 184 | - os=netbsd | |
| 197 | + os=netbsd | |
| 185 | 198 | ;; |
| 186 | 199 | esac |
| 187 | 200 | # The OS release |
| 188 | 201 | # Debian GNU/NetBSD machines have a different userland, and |
| 189 | 202 | # thus, need a distinct triplet. However, they do not need |
| @@ -200,10 +213,14 @@ | ||
| 200 | 213 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
| 201 | 214 | # contains redundant information, the shorter form: |
| 202 | 215 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
| 203 | 216 | echo "${machine}-${os}${release}" |
| 204 | 217 | exit ;; |
| 218 | + *:Bitrig:*:*) | |
| 219 | + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` | |
| 220 | + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} | |
| 221 | + exit ;; | |
| 205 | 222 | *:OpenBSD:*:*) |
| 206 | 223 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
| 207 | 224 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
| 208 | 225 | exit ;; |
| 209 | 226 | *:ekkoBSD:*:*) |
| @@ -222,11 +239,11 @@ | ||
| 222 | 239 | case $UNAME_RELEASE in |
| 223 | 240 | *4.0) |
| 224 | 241 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
| 225 | 242 | ;; |
| 226 | 243 | *5.*) |
| 227 | - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | |
| 244 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | |
| 228 | 245 | ;; |
| 229 | 246 | esac |
| 230 | 247 | # According to Compaq, /usr/sbin/psrinfo has been available on |
| 231 | 248 | # OSF/1 and Tru64 systems produced since 1995. I hope that |
| 232 | 249 | # covers most systems running today. This code pipes the CPU |
| @@ -268,11 +285,14 @@ | ||
| 268 | 285 | # A Vn.n version is a released version. |
| 269 | 286 | # A Tn.n version is a released field test version. |
| 270 | 287 | # A Xn.n version is an unreleased experimental baselevel. |
| 271 | 288 | # 1.2 uses "1.2" for uname -r. |
| 272 | 289 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 273 | - exit ;; | |
| 290 | + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. | |
| 291 | + exitcode=$? | |
| 292 | + trap '' 0 | |
| 293 | + exit $exitcode ;; | |
| 274 | 294 | Alpha\ *:Windows_NT*:*) |
| 275 | 295 | # How do we know it's Interix rather than the generic POSIX subsystem? |
| 276 | 296 | # Should we change UNAME_MACHINE based on the output of uname instead |
| 277 | 297 | # of the specific Alpha model? |
| 278 | 298 | echo alpha-pc-interix |
| @@ -294,16 +314,16 @@ | ||
| 294 | 314 | exit ;; |
| 295 | 315 | *:z/VM:*:*) |
| 296 | 316 | echo s390-ibm-zvmoe |
| 297 | 317 | exit ;; |
| 298 | 318 | *:OS400:*:*) |
| 299 | - echo powerpc-ibm-os400 | |
| 319 | + echo powerpc-ibm-os400 | |
| 300 | 320 | exit ;; |
| 301 | 321 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
| 302 | 322 | echo arm-acorn-riscix${UNAME_RELEASE} |
| 303 | 323 | exit ;; |
| 304 | - arm:riscos:*:*|arm:RISCOS:*:*) | |
| 324 | + arm*:riscos:*:*|arm*:RISCOS:*:*) | |
| 305 | 325 | echo arm-unknown-riscos |
| 306 | 326 | exit ;; |
| 307 | 327 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
| 308 | 328 | echo hppa1.1-hitachi-hiuxmpp |
| 309 | 329 | exit ;; |
| @@ -393,27 +413,27 @@ | ||
| 393 | 413 | # to the lowercase version "mint" (or "freemint"). Finally |
| 394 | 414 | # the system name "TOS" denotes a system which is actually not |
| 395 | 415 | # MiNT. But MiNT is downward compatible to TOS, so this should |
| 396 | 416 | # be no problem. |
| 397 | 417 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
| 398 | - echo m68k-atari-mint${UNAME_RELEASE} | |
| 418 | + echo m68k-atari-mint${UNAME_RELEASE} | |
| 399 | 419 | exit ;; |
| 400 | 420 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
| 401 | 421 | echo m68k-atari-mint${UNAME_RELEASE} |
| 402 | - exit ;; | |
| 422 | + exit ;; | |
| 403 | 423 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
| 404 | - echo m68k-atari-mint${UNAME_RELEASE} | |
| 424 | + echo m68k-atari-mint${UNAME_RELEASE} | |
| 405 | 425 | exit ;; |
| 406 | 426 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
| 407 | - echo m68k-milan-mint${UNAME_RELEASE} | |
| 408 | - exit ;; | |
| 427 | + echo m68k-milan-mint${UNAME_RELEASE} | |
| 428 | + exit ;; | |
| 409 | 429 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
| 410 | - echo m68k-hades-mint${UNAME_RELEASE} | |
| 411 | - exit ;; | |
| 430 | + echo m68k-hades-mint${UNAME_RELEASE} | |
| 431 | + exit ;; | |
| 412 | 432 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
| 413 | - echo m68k-unknown-mint${UNAME_RELEASE} | |
| 414 | - exit ;; | |
| 433 | + echo m68k-unknown-mint${UNAME_RELEASE} | |
| 434 | + exit ;; | |
| 415 | 435 | m68k:machten:*:*) |
| 416 | 436 | echo m68k-apple-machten${UNAME_RELEASE} |
| 417 | 437 | exit ;; |
| 418 | 438 | powerpc:machten:*:*) |
| 419 | 439 | echo powerpc-apple-machten${UNAME_RELEASE} |
| @@ -479,12 +499,12 @@ | ||
| 479 | 499 | exit ;; |
| 480 | 500 | m88k:*:3*:R3*) |
| 481 | 501 | echo m88k-motorola-sysv3 |
| 482 | 502 | exit ;; |
| 483 | 503 | AViiON:dgux:*:*) |
| 484 | - # DG/UX returns AViiON for all architectures | |
| 485 | - UNAME_PROCESSOR=`/usr/bin/uname -p` | |
| 504 | + # DG/UX returns AViiON for all architectures | |
| 505 | + UNAME_PROCESSOR=`/usr/bin/uname -p` | |
| 486 | 506 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] |
| 487 | 507 | then |
| 488 | 508 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ |
| 489 | 509 | [ ${TARGET_BINARY_INTERFACE}x = x ] |
| 490 | 510 | then |
| @@ -493,11 +513,11 @@ | ||
| 493 | 513 | echo m88k-dg-dguxbcs${UNAME_RELEASE} |
| 494 | 514 | fi |
| 495 | 515 | else |
| 496 | 516 | echo i586-dg-dgux${UNAME_RELEASE} |
| 497 | 517 | fi |
| 498 | - exit ;; | |
| 518 | + exit ;; | |
| 499 | 519 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
| 500 | 520 | echo m88k-dolphin-sysv3 |
| 501 | 521 | exit ;; |
| 502 | 522 | M88*:*:R3*:*) |
| 503 | 523 | # Delta 88k system running SVR3 |
| @@ -593,56 +613,56 @@ | ||
| 593 | 613 | 9000/31? ) HP_ARCH=m68000 ;; |
| 594 | 614 | 9000/[34]?? ) HP_ARCH=m68k ;; |
| 595 | 615 | 9000/[678][0-9][0-9]) |
| 596 | 616 | if [ -x /usr/bin/getconf ]; then |
| 597 | 617 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
| 598 | - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | |
| 599 | - case "${sc_cpu_version}" in | |
| 600 | - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | |
| 601 | - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | |
| 602 | - 532) # CPU_PA_RISC2_0 | |
| 603 | - case "${sc_kernel_bits}" in | |
| 604 | - 32) HP_ARCH="hppa2.0n" ;; | |
| 605 | - 64) HP_ARCH="hppa2.0w" ;; | |
| 618 | + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | |
| 619 | + case "${sc_cpu_version}" in | |
| 620 | + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | |
| 621 | + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | |
| 622 | + 532) # CPU_PA_RISC2_0 | |
| 623 | + case "${sc_kernel_bits}" in | |
| 624 | + 32) HP_ARCH="hppa2.0n" ;; | |
| 625 | + 64) HP_ARCH="hppa2.0w" ;; | |
| 606 | 626 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 |
| 607 | - esac ;; | |
| 608 | - esac | |
| 627 | + esac ;; | |
| 628 | + esac | |
| 609 | 629 | fi |
| 610 | 630 | if [ "${HP_ARCH}" = "" ]; then |
| 611 | 631 | eval $set_cc_for_build |
| 612 | - sed 's/^ //' << EOF >$dummy.c | |
| 613 | - | |
| 614 | - #define _HPUX_SOURCE | |
| 615 | - #include <stdlib.h> | |
| 616 | - #include <unistd.h> | |
| 617 | - | |
| 618 | - int main () | |
| 619 | - { | |
| 620 | - #if defined(_SC_KERNEL_BITS) | |
| 621 | - long bits = sysconf(_SC_KERNEL_BITS); | |
| 622 | - #endif | |
| 623 | - long cpu = sysconf (_SC_CPU_VERSION); | |
| 624 | - | |
| 625 | - switch (cpu) | |
| 626 | - { | |
| 627 | - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; | |
| 628 | - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; | |
| 629 | - case CPU_PA_RISC2_0: | |
| 630 | - #if defined(_SC_KERNEL_BITS) | |
| 631 | - switch (bits) | |
| 632 | - { | |
| 633 | - case 64: puts ("hppa2.0w"); break; | |
| 634 | - case 32: puts ("hppa2.0n"); break; | |
| 635 | - default: puts ("hppa2.0"); break; | |
| 636 | - } break; | |
| 637 | - #else /* !defined(_SC_KERNEL_BITS) */ | |
| 638 | - puts ("hppa2.0"); break; | |
| 639 | - #endif | |
| 640 | - default: puts ("hppa1.0"); break; | |
| 641 | - } | |
| 642 | - exit (0); | |
| 643 | - } | |
| 632 | + sed 's/^ //' << EOF >$dummy.c | |
| 633 | + | |
| 634 | + #define _HPUX_SOURCE | |
| 635 | + #include <stdlib.h> | |
| 636 | + #include <unistd.h> | |
| 637 | + | |
| 638 | + int main () | |
| 639 | + { | |
| 640 | + #if defined(_SC_KERNEL_BITS) | |
| 641 | + long bits = sysconf(_SC_KERNEL_BITS); | |
| 642 | + #endif | |
| 643 | + long cpu = sysconf (_SC_CPU_VERSION); | |
| 644 | + | |
| 645 | + switch (cpu) | |
| 646 | + { | |
| 647 | + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; | |
| 648 | + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; | |
| 649 | + case CPU_PA_RISC2_0: | |
| 650 | + #if defined(_SC_KERNEL_BITS) | |
| 651 | + switch (bits) | |
| 652 | + { | |
| 653 | + case 64: puts ("hppa2.0w"); break; | |
| 654 | + case 32: puts ("hppa2.0n"); break; | |
| 655 | + default: puts ("hppa2.0"); break; | |
| 656 | + } break; | |
| 657 | + #else /* !defined(_SC_KERNEL_BITS) */ | |
| 658 | + puts ("hppa2.0"); break; | |
| 659 | + #endif | |
| 660 | + default: puts ("hppa1.0"); break; | |
| 661 | + } | |
| 662 | + exit (0); | |
| 663 | + } | |
| 644 | 664 | EOF |
| 645 | 665 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` |
| 646 | 666 | test -z "$HP_ARCH" && HP_ARCH=hppa |
| 647 | 667 | fi ;; |
| 648 | 668 | esac |
| @@ -729,26 +749,26 @@ | ||
| 729 | 749 | parisc*:Lites*:*:*) |
| 730 | 750 | echo hppa1.1-hp-lites |
| 731 | 751 | exit ;; |
| 732 | 752 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) |
| 733 | 753 | echo c1-convex-bsd |
| 734 | - exit ;; | |
| 754 | + exit ;; | |
| 735 | 755 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) |
| 736 | 756 | if getsysinfo -f scalar_acc |
| 737 | 757 | then echo c32-convex-bsd |
| 738 | 758 | else echo c2-convex-bsd |
| 739 | 759 | fi |
| 740 | - exit ;; | |
| 760 | + exit ;; | |
| 741 | 761 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) |
| 742 | 762 | echo c34-convex-bsd |
| 743 | - exit ;; | |
| 763 | + exit ;; | |
| 744 | 764 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) |
| 745 | 765 | echo c38-convex-bsd |
| 746 | - exit ;; | |
| 766 | + exit ;; | |
| 747 | 767 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) |
| 748 | 768 | echo c4-convex-bsd |
| 749 | - exit ;; | |
| 769 | + exit ;; | |
| 750 | 770 | CRAY*Y-MP:*:*:*) |
| 751 | 771 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 752 | 772 | exit ;; |
| 753 | 773 | CRAY*[A-Z]90:*:*:*) |
| 754 | 774 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ |
| @@ -768,18 +788,18 @@ | ||
| 768 | 788 | *:UNICOS/mp:*:*) |
| 769 | 789 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 770 | 790 | exit ;; |
| 771 | 791 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
| 772 | 792 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 773 | - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
| 774 | - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | |
| 775 | - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
| 776 | - exit ;; | |
| 793 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
| 794 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | |
| 795 | + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
| 796 | + exit ;; | |
| 777 | 797 | 5000:UNIX_System_V:4.*:*) |
| 778 | - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
| 779 | - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | |
| 780 | - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
| 798 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
| 799 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | |
| 800 | + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
| 781 | 801 | exit ;; |
| 782 | 802 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
| 783 | 803 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} |
| 784 | 804 | exit ;; |
| 785 | 805 | sparc*:BSD/OS:*:*) |
| @@ -787,37 +807,39 @@ | ||
| 787 | 807 | exit ;; |
| 788 | 808 | *:BSD/OS:*:*) |
| 789 | 809 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
| 790 | 810 | exit ;; |
| 791 | 811 | *:FreeBSD:*:*) |
| 792 | - case ${UNAME_MACHINE} in | |
| 793 | - pc98) | |
| 794 | - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
| 812 | + UNAME_PROCESSOR=`/usr/bin/uname -p` | |
| 813 | + case ${UNAME_PROCESSOR} in | |
| 795 | 814 | amd64) |
| 796 | 815 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 797 | 816 | *) |
| 798 | - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
| 817 | + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
| 799 | 818 | esac |
| 800 | 819 | exit ;; |
| 801 | 820 | i*:CYGWIN*:*) |
| 802 | 821 | echo ${UNAME_MACHINE}-pc-cygwin |
| 803 | 822 | exit ;; |
| 823 | + *:MINGW64*:*) | |
| 824 | + echo ${UNAME_MACHINE}-pc-mingw64 | |
| 825 | + exit ;; | |
| 804 | 826 | *:MINGW*:*) |
| 805 | 827 | echo ${UNAME_MACHINE}-pc-mingw32 |
| 806 | 828 | exit ;; |
| 807 | - i*:MSYS*:*) | |
| 808 | - echo ${UNAME_MACHINE}-pc-msys | |
| 809 | - exit ;; | |
| 829 | + *:MSYS*:*) | |
| 830 | + echo ${UNAME_MACHINE}-pc-msys | |
| 831 | + exit ;; | |
| 810 | 832 | i*:windows32*:*) |
| 811 | - # uname -m includes "-pc" on this system. | |
| 812 | - echo ${UNAME_MACHINE}-mingw32 | |
| 833 | + # uname -m includes "-pc" on this system. | |
| 834 | + echo ${UNAME_MACHINE}-mingw32 | |
| 813 | 835 | exit ;; |
| 814 | 836 | i*:PW*:*) |
| 815 | 837 | echo ${UNAME_MACHINE}-pc-pw32 |
| 816 | 838 | exit ;; |
| 817 | 839 | *:Interix*:*) |
| 818 | - case ${UNAME_MACHINE} in | |
| 840 | + case ${UNAME_MACHINE} in | |
| 819 | 841 | x86) |
| 820 | 842 | echo i586-pc-interix${UNAME_RELEASE} |
| 821 | 843 | exit ;; |
| 822 | 844 | authenticamd | genuineintel | EM64T) |
| 823 | 845 | echo x86_64-unknown-interix${UNAME_RELEASE} |
| @@ -850,74 +872,85 @@ | ||
| 850 | 872 | prep*:SunOS:5.*:*) |
| 851 | 873 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
| 852 | 874 | exit ;; |
| 853 | 875 | *:GNU:*:*) |
| 854 | 876 | # the GNU system |
| 855 | - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
| 877 | + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
| 856 | 878 | exit ;; |
| 857 | 879 | *:GNU/*:*:*) |
| 858 | 880 | # other systems with GNU libc and userland |
| 859 | - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | |
| 881 | + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
| 860 | 882 | exit ;; |
| 861 | 883 | i*86:Minix:*:*) |
| 862 | 884 | echo ${UNAME_MACHINE}-pc-minix |
| 863 | 885 | exit ;; |
| 886 | + aarch64:Linux:*:*) | |
| 887 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 888 | + exit ;; | |
| 889 | + aarch64_be:Linux:*:*) | |
| 890 | + UNAME_MACHINE=aarch64_be | |
| 891 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 892 | + exit ;; | |
| 864 | 893 | alpha:Linux:*:*) |
| 865 | 894 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 866 | 895 | EV5) UNAME_MACHINE=alphaev5 ;; |
| 867 | 896 | EV56) UNAME_MACHINE=alphaev56 ;; |
| 868 | 897 | PCA56) UNAME_MACHINE=alphapca56 ;; |
| 869 | 898 | PCA57) UNAME_MACHINE=alphapca56 ;; |
| 870 | 899 | EV6) UNAME_MACHINE=alphaev6 ;; |
| 871 | 900 | EV67) UNAME_MACHINE=alphaev67 ;; |
| 872 | 901 | EV68*) UNAME_MACHINE=alphaev68 ;; |
| 873 | - esac | |
| 902 | + esac | |
| 874 | 903 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
| 875 | - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | |
| 876 | - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | |
| 904 | + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi | |
| 905 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 906 | + exit ;; | |
| 907 | + arc:Linux:*:* | arceb:Linux:*:*) | |
| 908 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 877 | 909 | exit ;; |
| 878 | 910 | arm*:Linux:*:*) |
| 879 | 911 | eval $set_cc_for_build |
| 880 | 912 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 881 | 913 | | grep -q __ARM_EABI__ |
| 882 | 914 | then |
| 883 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 915 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 884 | 916 | else |
| 885 | - echo ${UNAME_MACHINE}-unknown-linux-gnueabi | |
| 917 | + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | |
| 918 | + | grep -q __ARM_PCS_VFP | |
| 919 | + then | |
| 920 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi | |
| 921 | + else | |
| 922 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf | |
| 923 | + fi | |
| 886 | 924 | fi |
| 887 | 925 | exit ;; |
| 888 | 926 | avr32*:Linux:*:*) |
| 889 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 927 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 890 | 928 | exit ;; |
| 891 | 929 | cris:Linux:*:*) |
| 892 | - echo cris-axis-linux-gnu | |
| 930 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
| 893 | 931 | exit ;; |
| 894 | 932 | crisv32:Linux:*:*) |
| 895 | - echo crisv32-axis-linux-gnu | |
| 933 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
| 896 | 934 | exit ;; |
| 897 | 935 | frv:Linux:*:*) |
| 898 | - echo frv-unknown-linux-gnu | |
| 936 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 937 | + exit ;; | |
| 938 | + hexagon:Linux:*:*) | |
| 939 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 899 | 940 | exit ;; |
| 900 | 941 | i*86:Linux:*:*) |
| 901 | - LIBC=gnu | |
| 902 | - eval $set_cc_for_build | |
| 903 | - sed 's/^ //' << EOF >$dummy.c | |
| 904 | - #ifdef __dietlibc__ | |
| 905 | - LIBC=dietlibc | |
| 906 | - #endif | |
| 907 | -EOF | |
| 908 | - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` | |
| 909 | - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | |
| 942 | + echo ${UNAME_MACHINE}-pc-linux-${LIBC} | |
| 910 | 943 | exit ;; |
| 911 | 944 | ia64:Linux:*:*) |
| 912 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 945 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 913 | 946 | exit ;; |
| 914 | 947 | m32r*:Linux:*:*) |
| 915 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 948 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 916 | 949 | exit ;; |
| 917 | 950 | m68*:Linux:*:*) |
| 918 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 951 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 919 | 952 | exit ;; |
| 920 | 953 | mips:Linux:*:* | mips64:Linux:*:*) |
| 921 | 954 | eval $set_cc_for_build |
| 922 | 955 | sed 's/^ //' << EOF >$dummy.c |
| 923 | 956 | #undef CPU |
| @@ -932,71 +965,80 @@ | ||
| 932 | 965 | CPU= |
| 933 | 966 | #endif |
| 934 | 967 | #endif |
| 935 | 968 | EOF |
| 936 | 969 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
| 937 | - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | |
| 970 | + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } | |
| 938 | 971 | ;; |
| 939 | - or32:Linux:*:*) | |
| 940 | - echo or32-unknown-linux-gnu | |
| 972 | + openrisc*:Linux:*:*) | |
| 973 | + echo or1k-unknown-linux-${LIBC} | |
| 974 | + exit ;; | |
| 975 | + or32:Linux:*:* | or1k*:Linux:*:*) | |
| 976 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 941 | 977 | exit ;; |
| 942 | 978 | padre:Linux:*:*) |
| 943 | - echo sparc-unknown-linux-gnu | |
| 979 | + echo sparc-unknown-linux-${LIBC} | |
| 944 | 980 | exit ;; |
| 945 | 981 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 946 | - echo hppa64-unknown-linux-gnu | |
| 982 | + echo hppa64-unknown-linux-${LIBC} | |
| 947 | 983 | exit ;; |
| 948 | 984 | parisc:Linux:*:* | hppa:Linux:*:*) |
| 949 | 985 | # Look for CPU level |
| 950 | 986 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
| 951 | - PA7*) echo hppa1.1-unknown-linux-gnu ;; | |
| 952 | - PA8*) echo hppa2.0-unknown-linux-gnu ;; | |
| 953 | - *) echo hppa-unknown-linux-gnu ;; | |
| 987 | + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; | |
| 988 | + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; | |
| 989 | + *) echo hppa-unknown-linux-${LIBC} ;; | |
| 954 | 990 | esac |
| 955 | 991 | exit ;; |
| 956 | 992 | ppc64:Linux:*:*) |
| 957 | - echo powerpc64-unknown-linux-gnu | |
| 993 | + echo powerpc64-unknown-linux-${LIBC} | |
| 958 | 994 | exit ;; |
| 959 | 995 | ppc:Linux:*:*) |
| 960 | - echo powerpc-unknown-linux-gnu | |
| 996 | + echo powerpc-unknown-linux-${LIBC} | |
| 997 | + exit ;; | |
| 998 | + ppc64le:Linux:*:*) | |
| 999 | + echo powerpc64le-unknown-linux-${LIBC} | |
| 1000 | + exit ;; | |
| 1001 | + ppcle:Linux:*:*) | |
| 1002 | + echo powerpcle-unknown-linux-${LIBC} | |
| 961 | 1003 | exit ;; |
| 962 | 1004 | s390:Linux:*:* | s390x:Linux:*:*) |
| 963 | - echo ${UNAME_MACHINE}-ibm-linux | |
| 1005 | + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} | |
| 964 | 1006 | exit ;; |
| 965 | 1007 | sh64*:Linux:*:*) |
| 966 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1008 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 967 | 1009 | exit ;; |
| 968 | 1010 | sh*:Linux:*:*) |
| 969 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1011 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 970 | 1012 | exit ;; |
| 971 | 1013 | sparc:Linux:*:* | sparc64:Linux:*:*) |
| 972 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1014 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 973 | 1015 | exit ;; |
| 974 | 1016 | tile*:Linux:*:*) |
| 975 | - echo ${UNAME_MACHINE}-tilera-linux-gnu | |
| 1017 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 976 | 1018 | exit ;; |
| 977 | 1019 | vax:Linux:*:*) |
| 978 | - echo ${UNAME_MACHINE}-dec-linux-gnu | |
| 1020 | + echo ${UNAME_MACHINE}-dec-linux-${LIBC} | |
| 979 | 1021 | exit ;; |
| 980 | 1022 | x86_64:Linux:*:*) |
| 981 | - echo x86_64-unknown-linux-gnu | |
| 1023 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 982 | 1024 | exit ;; |
| 983 | 1025 | xtensa*:Linux:*:*) |
| 984 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1026 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 985 | 1027 | exit ;; |
| 986 | 1028 | i*86:DYNIX/ptx:4*:*) |
| 987 | 1029 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
| 988 | 1030 | # earlier versions are messed up and put the nodename in both |
| 989 | 1031 | # sysname and nodename. |
| 990 | 1032 | echo i386-sequent-sysv4 |
| 991 | 1033 | exit ;; |
| 992 | 1034 | i*86:UNIX_SV:4.2MP:2.*) |
| 993 | - # Unixware is an offshoot of SVR4, but it has its own version | |
| 994 | - # number series starting with 2... | |
| 995 | - # I am not positive that other SVR4 systems won't match this, | |
| 1035 | + # Unixware is an offshoot of SVR4, but it has its own version | |
| 1036 | + # number series starting with 2... | |
| 1037 | + # I am not positive that other SVR4 systems won't match this, | |
| 996 | 1038 | # I just have to hope. -- rms. |
| 997 | - # Use sysv4.2uw... so that sysv4* matches it. | |
| 1039 | + # Use sysv4.2uw... so that sysv4* matches it. | |
| 998 | 1040 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
| 999 | 1041 | exit ;; |
| 1000 | 1042 | i*86:OS/2:*:*) |
| 1001 | 1043 | # If we were able to find `uname', then EMX Unix compatibility |
| 1002 | 1044 | # is probably installed. |
| @@ -1024,11 +1066,11 @@ | ||
| 1024 | 1066 | else |
| 1025 | 1067 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
| 1026 | 1068 | fi |
| 1027 | 1069 | exit ;; |
| 1028 | 1070 | i*86:*:5:[678]*) |
| 1029 | - # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
| 1071 | + # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
| 1030 | 1072 | case `/bin/uname -X | grep "^Machine"` in |
| 1031 | 1073 | *486*) UNAME_MACHINE=i486 ;; |
| 1032 | 1074 | *Pentium) UNAME_MACHINE=i586 ;; |
| 1033 | 1075 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
| 1034 | 1076 | esac |
| @@ -1052,17 +1094,17 @@ | ||
| 1052 | 1094 | echo ${UNAME_MACHINE}-pc-sysv32 |
| 1053 | 1095 | fi |
| 1054 | 1096 | exit ;; |
| 1055 | 1097 | pc:*:*:*) |
| 1056 | 1098 | # Left here for compatibility: |
| 1057 | - # uname -m prints for DJGPP always 'pc', but it prints nothing about | |
| 1058 | - # the processor, so we play safe by assuming i586. | |
| 1099 | + # uname -m prints for DJGPP always 'pc', but it prints nothing about | |
| 1100 | + # the processor, so we play safe by assuming i586. | |
| 1059 | 1101 | # Note: whatever this is, it MUST be the same as what config.sub |
| 1060 | 1102 | # prints for the "djgpp" host, or else GDB configury will decide that |
| 1061 | 1103 | # this is a cross-build. |
| 1062 | 1104 | echo i586-pc-msdosdjgpp |
| 1063 | - exit ;; | |
| 1105 | + exit ;; | |
| 1064 | 1106 | Intel:Mach:3*:*) |
| 1065 | 1107 | echo i386-pc-mach3 |
| 1066 | 1108 | exit ;; |
| 1067 | 1109 | paragon:*:*:*) |
| 1068 | 1110 | echo i860-intel-osf1 |
| @@ -1093,12 +1135,12 @@ | ||
| 1093 | 1135 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1094 | 1136 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } |
| 1095 | 1137 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
| 1096 | 1138 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; |
| 1097 | 1139 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) |
| 1098 | - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
| 1099 | - && { echo i486-ncr-sysv4; exit; } ;; | |
| 1140 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
| 1141 | + && { echo i486-ncr-sysv4; exit; } ;; | |
| 1100 | 1142 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) |
| 1101 | 1143 | OS_REL='.3' |
| 1102 | 1144 | test -r /etc/.relid \ |
| 1103 | 1145 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
| 1104 | 1146 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| @@ -1137,14 +1179,14 @@ | ||
| 1137 | 1179 | echo ${UNAME_MACHINE}-sni-sysv4 |
| 1138 | 1180 | else |
| 1139 | 1181 | echo ns32k-sni-sysv |
| 1140 | 1182 | fi |
| 1141 | 1183 | exit ;; |
| 1142 | - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | |
| 1143 | - # says <[email protected]> | |
| 1144 | - echo i586-unisys-sysv4 | |
| 1145 | - exit ;; | |
| 1184 | + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | |
| 1185 | + # says <[email protected]> | |
| 1186 | + echo i586-unisys-sysv4 | |
| 1187 | + exit ;; | |
| 1146 | 1188 | *:UNIX_System_V:4*:FTX*) |
| 1147 | 1189 | # From Gerald Hewes <[email protected]>. |
| 1148 | 1190 | # How about differentiating between stratus architectures? -djm |
| 1149 | 1191 | echo hppa1.1-stratus-sysv4 |
| 1150 | 1192 | exit ;; |
| @@ -1166,15 +1208,15 @@ | ||
| 1166 | 1208 | news*:NEWS-OS:6*:*) |
| 1167 | 1209 | echo mips-sony-newsos6 |
| 1168 | 1210 | exit ;; |
| 1169 | 1211 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
| 1170 | 1212 | if [ -d /usr/nec ]; then |
| 1171 | - echo mips-nec-sysv${UNAME_RELEASE} | |
| 1213 | + echo mips-nec-sysv${UNAME_RELEASE} | |
| 1172 | 1214 | else |
| 1173 | - echo mips-unknown-sysv${UNAME_RELEASE} | |
| 1215 | + echo mips-unknown-sysv${UNAME_RELEASE} | |
| 1174 | 1216 | fi |
| 1175 | - exit ;; | |
| 1217 | + exit ;; | |
| 1176 | 1218 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
| 1177 | 1219 | echo powerpc-be-beos |
| 1178 | 1220 | exit ;; |
| 1179 | 1221 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. |
| 1180 | 1222 | echo powerpc-apple-beos |
| @@ -1183,10 +1225,13 @@ | ||
| 1183 | 1225 | echo i586-pc-beos |
| 1184 | 1226 | exit ;; |
| 1185 | 1227 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
| 1186 | 1228 | echo i586-pc-haiku |
| 1187 | 1229 | exit ;; |
| 1230 | + x86_64:Haiku:*:*) | |
| 1231 | + echo x86_64-unknown-haiku | |
| 1232 | + exit ;; | |
| 1188 | 1233 | SX-4:SUPER-UX:*:*) |
| 1189 | 1234 | echo sx4-nec-superux${UNAME_RELEASE} |
| 1190 | 1235 | exit ;; |
| 1191 | 1236 | SX-5:SUPER-UX:*:*) |
| 1192 | 1237 | echo sx5-nec-superux${UNAME_RELEASE} |
| @@ -1209,23 +1254,35 @@ | ||
| 1209 | 1254 | *:Rhapsody:*:*) |
| 1210 | 1255 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
| 1211 | 1256 | exit ;; |
| 1212 | 1257 | *:Darwin:*:*) |
| 1213 | 1258 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
| 1214 | - case $UNAME_PROCESSOR in | |
| 1215 | - i386) | |
| 1216 | - eval $set_cc_for_build | |
| 1217 | - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
| 1218 | - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
| 1219 | - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
| 1220 | - grep IS_64BIT_ARCH >/dev/null | |
| 1221 | - then | |
| 1222 | - UNAME_PROCESSOR="x86_64" | |
| 1223 | - fi | |
| 1224 | - fi ;; | |
| 1225 | - unknown) UNAME_PROCESSOR=powerpc ;; | |
| 1226 | - esac | |
| 1259 | + eval $set_cc_for_build | |
| 1260 | + if test "$UNAME_PROCESSOR" = unknown ; then | |
| 1261 | + UNAME_PROCESSOR=powerpc | |
| 1262 | + fi | |
| 1263 | + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then | |
| 1264 | + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
| 1265 | + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
| 1266 | + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
| 1267 | + grep IS_64BIT_ARCH >/dev/null | |
| 1268 | + then | |
| 1269 | + case $UNAME_PROCESSOR in | |
| 1270 | + i386) UNAME_PROCESSOR=x86_64 ;; | |
| 1271 | + powerpc) UNAME_PROCESSOR=powerpc64 ;; | |
| 1272 | + esac | |
| 1273 | + fi | |
| 1274 | + fi | |
| 1275 | + elif test "$UNAME_PROCESSOR" = i386 ; then | |
| 1276 | + # Avoid executing cc on OS X 10.9, as it ships with a stub | |
| 1277 | + # that puts up a graphical alert prompting to install | |
| 1278 | + # developer tools. Any system running Mac OS X 10.7 or | |
| 1279 | + # later (Darwin 11 and later) is required to have a 64-bit | |
| 1280 | + # processor. This is not true of the ARM version of Darwin | |
| 1281 | + # that Apple uses in portable devices. | |
| 1282 | + UNAME_PROCESSOR=x86_64 | |
| 1283 | + fi | |
| 1227 | 1284 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
| 1228 | 1285 | exit ;; |
| 1229 | 1286 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
| 1230 | 1287 | UNAME_PROCESSOR=`uname -p` |
| 1231 | 1288 | if test "$UNAME_PROCESSOR" = "x86"; then |
| @@ -1238,11 +1295,11 @@ | ||
| 1238 | 1295 | echo i386-pc-qnx |
| 1239 | 1296 | exit ;; |
| 1240 | 1297 | NEO-?:NONSTOP_KERNEL:*:*) |
| 1241 | 1298 | echo neo-tandem-nsk${UNAME_RELEASE} |
| 1242 | 1299 | exit ;; |
| 1243 | - NSE-?:NONSTOP_KERNEL:*:*) | |
| 1300 | + NSE-*:NONSTOP_KERNEL:*:*) | |
| 1244 | 1301 | echo nse-tandem-nsk${UNAME_RELEASE} |
| 1245 | 1302 | exit ;; |
| 1246 | 1303 | NSR-?:NONSTOP_KERNEL:*:*) |
| 1247 | 1304 | echo nsr-tandem-nsk${UNAME_RELEASE} |
| 1248 | 1305 | exit ;; |
| @@ -1283,17 +1340,17 @@ | ||
| 1283 | 1340 | exit ;; |
| 1284 | 1341 | *:ITS:*:*) |
| 1285 | 1342 | echo pdp10-unknown-its |
| 1286 | 1343 | exit ;; |
| 1287 | 1344 | SEI:*:*:SEIUX) |
| 1288 | - echo mips-sei-seiux${UNAME_RELEASE} | |
| 1345 | + echo mips-sei-seiux${UNAME_RELEASE} | |
| 1289 | 1346 | exit ;; |
| 1290 | 1347 | *:DragonFly:*:*) |
| 1291 | 1348 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
| 1292 | 1349 | exit ;; |
| 1293 | 1350 | *:*VMS:*:*) |
| 1294 | - UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
| 1351 | + UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
| 1295 | 1352 | case "${UNAME_MACHINE}" in |
| 1296 | 1353 | A*) echo alpha-dec-vms ; exit ;; |
| 1297 | 1354 | I*) echo ia64-dec-vms ; exit ;; |
| 1298 | 1355 | V*) echo vax-dec-vms ; exit ;; |
| 1299 | 1356 | esac ;; |
| @@ -1307,162 +1364,14 @@ | ||
| 1307 | 1364 | echo ${UNAME_MACHINE}-pc-rdos |
| 1308 | 1365 | exit ;; |
| 1309 | 1366 | i*86:AROS:*:*) |
| 1310 | 1367 | echo ${UNAME_MACHINE}-pc-aros |
| 1311 | 1368 | exit ;; |
| 1312 | -esac | |
| 1313 | - | |
| 1314 | -#echo '(No uname command or uname output not recognized.)' 1>&2 | |
| 1315 | -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 | |
| 1316 | - | |
| 1317 | -eval $set_cc_for_build | |
| 1318 | -cat >$dummy.c <<EOF | |
| 1319 | -#ifdef _SEQUENT_ | |
| 1320 | -# include <sys/types.h> | |
| 1321 | -# include <sys/utsname.h> | |
| 1322 | -#endif | |
| 1323 | -main () | |
| 1324 | -{ | |
| 1325 | -#if defined (sony) | |
| 1326 | -#if defined (MIPSEB) | |
| 1327 | - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, | |
| 1328 | - I don't know.... */ | |
| 1329 | - printf ("mips-sony-bsd\n"); exit (0); | |
| 1330 | -#else | |
| 1331 | -#include <sys/param.h> | |
| 1332 | - printf ("m68k-sony-newsos%s\n", | |
| 1333 | -#ifdef NEWSOS4 | |
| 1334 | - "4" | |
| 1335 | -#else | |
| 1336 | - "" | |
| 1337 | -#endif | |
| 1338 | - ); exit (0); | |
| 1339 | -#endif | |
| 1340 | -#endif | |
| 1341 | - | |
| 1342 | -#if defined (__arm) && defined (__acorn) && defined (__unix) | |
| 1343 | - printf ("arm-acorn-riscix\n"); exit (0); | |
| 1344 | -#endif | |
| 1345 | - | |
| 1346 | -#if defined (hp300) && !defined (hpux) | |
| 1347 | - printf ("m68k-hp-bsd\n"); exit (0); | |
| 1348 | -#endif | |
| 1349 | - | |
| 1350 | -#if defined (NeXT) | |
| 1351 | -#if !defined (__ARCHITECTURE__) | |
| 1352 | -#define __ARCHITECTURE__ "m68k" | |
| 1353 | -#endif | |
| 1354 | - int version; | |
| 1355 | - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | |
| 1356 | - if (version < 4) | |
| 1357 | - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | |
| 1358 | - else | |
| 1359 | - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | |
| 1360 | - exit (0); | |
| 1361 | -#endif | |
| 1362 | - | |
| 1363 | -#if defined (MULTIMAX) || defined (n16) | |
| 1364 | -#if defined (UMAXV) | |
| 1365 | - printf ("ns32k-encore-sysv\n"); exit (0); | |
| 1366 | -#else | |
| 1367 | -#if defined (CMU) | |
| 1368 | - printf ("ns32k-encore-mach\n"); exit (0); | |
| 1369 | -#else | |
| 1370 | - printf ("ns32k-encore-bsd\n"); exit (0); | |
| 1371 | -#endif | |
| 1372 | -#endif | |
| 1373 | -#endif | |
| 1374 | - | |
| 1375 | -#if defined (__386BSD__) | |
| 1376 | - printf ("i386-pc-bsd\n"); exit (0); | |
| 1377 | -#endif | |
| 1378 | - | |
| 1379 | -#if defined (sequent) | |
| 1380 | -#if defined (i386) | |
| 1381 | - printf ("i386-sequent-dynix\n"); exit (0); | |
| 1382 | -#endif | |
| 1383 | -#if defined (ns32000) | |
| 1384 | - printf ("ns32k-sequent-dynix\n"); exit (0); | |
| 1385 | -#endif | |
| 1386 | -#endif | |
| 1387 | - | |
| 1388 | -#if defined (_SEQUENT_) | |
| 1389 | - struct utsname un; | |
| 1390 | - | |
| 1391 | - uname(&un); | |
| 1392 | - | |
| 1393 | - if (strncmp(un.version, "V2", 2) == 0) { | |
| 1394 | - printf ("i386-sequent-ptx2\n"); exit (0); | |
| 1395 | - } | |
| 1396 | - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | |
| 1397 | - printf ("i386-sequent-ptx1\n"); exit (0); | |
| 1398 | - } | |
| 1399 | - printf ("i386-sequent-ptx\n"); exit (0); | |
| 1400 | - | |
| 1401 | -#endif | |
| 1402 | - | |
| 1403 | -#if defined (vax) | |
| 1404 | -# if !defined (ultrix) | |
| 1405 | -# include <sys/param.h> | |
| 1406 | -# if defined (BSD) | |
| 1407 | -# if BSD == 43 | |
| 1408 | - printf ("vax-dec-bsd4.3\n"); exit (0); | |
| 1409 | -# else | |
| 1410 | -# if BSD == 199006 | |
| 1411 | - printf ("vax-dec-bsd4.3reno\n"); exit (0); | |
| 1412 | -# else | |
| 1413 | - printf ("vax-dec-bsd\n"); exit (0); | |
| 1414 | -# endif | |
| 1415 | -# endif | |
| 1416 | -# else | |
| 1417 | - printf ("vax-dec-bsd\n"); exit (0); | |
| 1418 | -# endif | |
| 1419 | -# else | |
| 1420 | - printf ("vax-dec-ultrix\n"); exit (0); | |
| 1421 | -# endif | |
| 1422 | -#endif | |
| 1423 | - | |
| 1424 | -#if defined (alliant) && defined (i860) | |
| 1425 | - printf ("i860-alliant-bsd\n"); exit (0); | |
| 1426 | -#endif | |
| 1427 | - | |
| 1428 | - exit (1); | |
| 1429 | -} | |
| 1430 | -EOF | |
| 1431 | - | |
| 1432 | -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && | |
| 1433 | - { echo "$SYSTEM_NAME"; exit; } | |
| 1434 | - | |
| 1435 | -# Apollos put the system type in the environment. | |
| 1436 | - | |
| 1437 | -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } | |
| 1438 | - | |
| 1439 | -# Convex versions that predate uname can use getsysinfo(1) | |
| 1440 | - | |
| 1441 | -if [ -x /usr/convex/getsysinfo ] | |
| 1442 | -then | |
| 1443 | - case `getsysinfo -f cpu_type` in | |
| 1444 | - c1*) | |
| 1445 | - echo c1-convex-bsd | |
| 1446 | - exit ;; | |
| 1447 | - c2*) | |
| 1448 | - if getsysinfo -f scalar_acc | |
| 1449 | - then echo c32-convex-bsd | |
| 1450 | - else echo c2-convex-bsd | |
| 1451 | - fi | |
| 1452 | - exit ;; | |
| 1453 | - c34*) | |
| 1454 | - echo c34-convex-bsd | |
| 1455 | - exit ;; | |
| 1456 | - c38*) | |
| 1457 | - echo c38-convex-bsd | |
| 1458 | - exit ;; | |
| 1459 | - c4*) | |
| 1460 | - echo c4-convex-bsd | |
| 1461 | - exit ;; | |
| 1462 | - esac | |
| 1463 | -fi | |
| 1369 | + x86_64:VMkernel:*:*) | |
| 1370 | + echo ${UNAME_MACHINE}-unknown-esx | |
| 1371 | + exit ;; | |
| 1372 | +esac | |
| 1464 | 1373 | |
| 1465 | 1374 | cat >&2 <<EOF |
| 1466 | 1375 | $0: unable to guess system type |
| 1467 | 1376 | |
| 1468 | 1377 | This script, last modified $timestamp, has failed to recognize |
| 1469 | 1378 |
| --- autosetup/config.guess | |
| +++ autosetup/config.guess | |
| @@ -1,44 +1,38 @@ | |
| 1 | #! /bin/sh |
| 2 | # Attempt to guess a canonical system name. |
| 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 5 | # Free Software Foundation, Inc. |
| 6 | |
| 7 | timestamp='2010-09-24' |
| 8 | |
| 9 | # This file is free software; you can redistribute it and/or modify it |
| 10 | # under the terms of the GNU General Public License as published by |
| 11 | # the Free Software Foundation; either version 2 of the License, or |
| 12 | # (at your option) any later version. |
| 13 | # |
| 14 | # This program is distributed in the hope that it will be useful, but |
| 15 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | # General Public License for more details. |
| 18 | # |
| 19 | # You should have received a copy of the GNU General Public License |
| 20 | # along with this program; if not, write to the Free Software |
| 21 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
| 22 | # 02110-1301, USA. |
| 23 | # |
| 24 | # As a special exception to the GNU General Public License, if you |
| 25 | # distribute this file as part of a program that contains a |
| 26 | # configuration script generated by Autoconf, you may include it under |
| 27 | # the same distribution terms that you use for the rest of that program. |
| 28 | |
| 29 | |
| 30 | # Originally written by Per Bothner. Please send patches (context |
| 31 | # diff format) to <[email protected]> and include a ChangeLog |
| 32 | # entry. |
| 33 | # |
| 34 | # This script attempts to guess a canonical system name similar to |
| 35 | # config.sub. If it succeeds, it prints the system name on stdout, and |
| 36 | # exits with 0. Otherwise, it exits with 1. |
| 37 | # |
| 38 | # You can get the latest version of this script from: |
| 39 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
| 40 | |
| 41 | me=`echo "$0" | sed -e 's,.*/,,'` |
| 42 | |
| 43 | usage="\ |
| 44 | Usage: $0 [OPTION] |
| @@ -54,13 +48,11 @@ | |
| 54 | |
| 55 | version="\ |
| 56 | GNU config.guess ($timestamp) |
| 57 | |
| 58 | Originally written by Per Bothner. |
| 59 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
| 60 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free |
| 61 | Software Foundation, Inc. |
| 62 | |
| 63 | This is free software; see the source for copying conditions. There is NO |
| 64 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 65 | |
| 66 | help=" |
| @@ -90,11 +82,11 @@ | |
| 90 | if test $# != 0; then |
| 91 | echo "$me: too many arguments$help" >&2 |
| 92 | exit 1 |
| 93 | fi |
| 94 | |
| 95 | trap 'exit 1' HUP INT TERM |
| 96 | |
| 97 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
| 98 | # compiler to aid in system detection is discouraged as it requires |
| 99 | # temporary files to be created and, as you can see below, it is a |
| 100 | # headache to deal with in a portable fashion. |
| @@ -104,11 +96,11 @@ | |
| 104 | |
| 105 | # Portable tmp directory creation inspired by the Autoconf team. |
| 106 | |
| 107 | set_cc_for_build=' |
| 108 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
| 109 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; |
| 110 | : ${TMPDIR=/tmp} ; |
| 111 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 112 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 113 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
| 114 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
| @@ -137,17 +129,38 @@ | |
| 137 | |
| 138 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
| 139 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
| 140 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
| 141 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
| 142 | |
| 143 | # Note: order is significant - the case branches are not exclusive. |
| 144 | |
| 145 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
| 146 | *:NetBSD:*:*) |
| 147 | # NetBSD (nbsd) targets should (where applicable) match one or |
| 148 | # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, |
| 149 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
| 150 | # switched to ELF, *-*-netbsd* would select the old |
| 151 | # object file format. This provides both forward |
| 152 | # compatibility and a consistent mechanism for selecting the |
| 153 | # object file format. |
| @@ -179,11 +192,11 @@ | |
| 179 | else |
| 180 | os=netbsdelf |
| 181 | fi |
| 182 | ;; |
| 183 | *) |
| 184 | os=netbsd |
| 185 | ;; |
| 186 | esac |
| 187 | # The OS release |
| 188 | # Debian GNU/NetBSD machines have a different userland, and |
| 189 | # thus, need a distinct triplet. However, they do not need |
| @@ -200,10 +213,14 @@ | |
| 200 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
| 201 | # contains redundant information, the shorter form: |
| 202 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
| 203 | echo "${machine}-${os}${release}" |
| 204 | exit ;; |
| 205 | *:OpenBSD:*:*) |
| 206 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
| 207 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
| 208 | exit ;; |
| 209 | *:ekkoBSD:*:*) |
| @@ -222,11 +239,11 @@ | |
| 222 | case $UNAME_RELEASE in |
| 223 | *4.0) |
| 224 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
| 225 | ;; |
| 226 | *5.*) |
| 227 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` |
| 228 | ;; |
| 229 | esac |
| 230 | # According to Compaq, /usr/sbin/psrinfo has been available on |
| 231 | # OSF/1 and Tru64 systems produced since 1995. I hope that |
| 232 | # covers most systems running today. This code pipes the CPU |
| @@ -268,11 +285,14 @@ | |
| 268 | # A Vn.n version is a released version. |
| 269 | # A Tn.n version is a released field test version. |
| 270 | # A Xn.n version is an unreleased experimental baselevel. |
| 271 | # 1.2 uses "1.2" for uname -r. |
| 272 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 273 | exit ;; |
| 274 | Alpha\ *:Windows_NT*:*) |
| 275 | # How do we know it's Interix rather than the generic POSIX subsystem? |
| 276 | # Should we change UNAME_MACHINE based on the output of uname instead |
| 277 | # of the specific Alpha model? |
| 278 | echo alpha-pc-interix |
| @@ -294,16 +314,16 @@ | |
| 294 | exit ;; |
| 295 | *:z/VM:*:*) |
| 296 | echo s390-ibm-zvmoe |
| 297 | exit ;; |
| 298 | *:OS400:*:*) |
| 299 | echo powerpc-ibm-os400 |
| 300 | exit ;; |
| 301 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
| 302 | echo arm-acorn-riscix${UNAME_RELEASE} |
| 303 | exit ;; |
| 304 | arm:riscos:*:*|arm:RISCOS:*:*) |
| 305 | echo arm-unknown-riscos |
| 306 | exit ;; |
| 307 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
| 308 | echo hppa1.1-hitachi-hiuxmpp |
| 309 | exit ;; |
| @@ -393,27 +413,27 @@ | |
| 393 | # to the lowercase version "mint" (or "freemint"). Finally |
| 394 | # the system name "TOS" denotes a system which is actually not |
| 395 | # MiNT. But MiNT is downward compatible to TOS, so this should |
| 396 | # be no problem. |
| 397 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
| 398 | echo m68k-atari-mint${UNAME_RELEASE} |
| 399 | exit ;; |
| 400 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
| 401 | echo m68k-atari-mint${UNAME_RELEASE} |
| 402 | exit ;; |
| 403 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
| 404 | echo m68k-atari-mint${UNAME_RELEASE} |
| 405 | exit ;; |
| 406 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
| 407 | echo m68k-milan-mint${UNAME_RELEASE} |
| 408 | exit ;; |
| 409 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
| 410 | echo m68k-hades-mint${UNAME_RELEASE} |
| 411 | exit ;; |
| 412 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
| 413 | echo m68k-unknown-mint${UNAME_RELEASE} |
| 414 | exit ;; |
| 415 | m68k:machten:*:*) |
| 416 | echo m68k-apple-machten${UNAME_RELEASE} |
| 417 | exit ;; |
| 418 | powerpc:machten:*:*) |
| 419 | echo powerpc-apple-machten${UNAME_RELEASE} |
| @@ -479,12 +499,12 @@ | |
| 479 | exit ;; |
| 480 | m88k:*:3*:R3*) |
| 481 | echo m88k-motorola-sysv3 |
| 482 | exit ;; |
| 483 | AViiON:dgux:*:*) |
| 484 | # DG/UX returns AViiON for all architectures |
| 485 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
| 486 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] |
| 487 | then |
| 488 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ |
| 489 | [ ${TARGET_BINARY_INTERFACE}x = x ] |
| 490 | then |
| @@ -493,11 +513,11 @@ | |
| 493 | echo m88k-dg-dguxbcs${UNAME_RELEASE} |
| 494 | fi |
| 495 | else |
| 496 | echo i586-dg-dgux${UNAME_RELEASE} |
| 497 | fi |
| 498 | exit ;; |
| 499 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
| 500 | echo m88k-dolphin-sysv3 |
| 501 | exit ;; |
| 502 | M88*:*:R3*:*) |
| 503 | # Delta 88k system running SVR3 |
| @@ -593,56 +613,56 @@ | |
| 593 | 9000/31? ) HP_ARCH=m68000 ;; |
| 594 | 9000/[34]?? ) HP_ARCH=m68k ;; |
| 595 | 9000/[678][0-9][0-9]) |
| 596 | if [ -x /usr/bin/getconf ]; then |
| 597 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
| 598 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` |
| 599 | case "${sc_cpu_version}" in |
| 600 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 |
| 601 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 |
| 602 | 532) # CPU_PA_RISC2_0 |
| 603 | case "${sc_kernel_bits}" in |
| 604 | 32) HP_ARCH="hppa2.0n" ;; |
| 605 | 64) HP_ARCH="hppa2.0w" ;; |
| 606 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 |
| 607 | esac ;; |
| 608 | esac |
| 609 | fi |
| 610 | if [ "${HP_ARCH}" = "" ]; then |
| 611 | eval $set_cc_for_build |
| 612 | sed 's/^ //' << EOF >$dummy.c |
| 613 | |
| 614 | #define _HPUX_SOURCE |
| 615 | #include <stdlib.h> |
| 616 | #include <unistd.h> |
| 617 | |
| 618 | int main () |
| 619 | { |
| 620 | #if defined(_SC_KERNEL_BITS) |
| 621 | long bits = sysconf(_SC_KERNEL_BITS); |
| 622 | #endif |
| 623 | long cpu = sysconf (_SC_CPU_VERSION); |
| 624 | |
| 625 | switch (cpu) |
| 626 | { |
| 627 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; |
| 628 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; |
| 629 | case CPU_PA_RISC2_0: |
| 630 | #if defined(_SC_KERNEL_BITS) |
| 631 | switch (bits) |
| 632 | { |
| 633 | case 64: puts ("hppa2.0w"); break; |
| 634 | case 32: puts ("hppa2.0n"); break; |
| 635 | default: puts ("hppa2.0"); break; |
| 636 | } break; |
| 637 | #else /* !defined(_SC_KERNEL_BITS) */ |
| 638 | puts ("hppa2.0"); break; |
| 639 | #endif |
| 640 | default: puts ("hppa1.0"); break; |
| 641 | } |
| 642 | exit (0); |
| 643 | } |
| 644 | EOF |
| 645 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` |
| 646 | test -z "$HP_ARCH" && HP_ARCH=hppa |
| 647 | fi ;; |
| 648 | esac |
| @@ -729,26 +749,26 @@ | |
| 729 | parisc*:Lites*:*:*) |
| 730 | echo hppa1.1-hp-lites |
| 731 | exit ;; |
| 732 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) |
| 733 | echo c1-convex-bsd |
| 734 | exit ;; |
| 735 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) |
| 736 | if getsysinfo -f scalar_acc |
| 737 | then echo c32-convex-bsd |
| 738 | else echo c2-convex-bsd |
| 739 | fi |
| 740 | exit ;; |
| 741 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) |
| 742 | echo c34-convex-bsd |
| 743 | exit ;; |
| 744 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) |
| 745 | echo c38-convex-bsd |
| 746 | exit ;; |
| 747 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) |
| 748 | echo c4-convex-bsd |
| 749 | exit ;; |
| 750 | CRAY*Y-MP:*:*:*) |
| 751 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 752 | exit ;; |
| 753 | CRAY*[A-Z]90:*:*:*) |
| 754 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ |
| @@ -768,18 +788,18 @@ | |
| 768 | *:UNICOS/mp:*:*) |
| 769 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 770 | exit ;; |
| 771 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
| 772 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 773 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
| 774 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` |
| 775 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
| 776 | exit ;; |
| 777 | 5000:UNIX_System_V:4.*:*) |
| 778 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
| 779 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` |
| 780 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
| 781 | exit ;; |
| 782 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
| 783 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} |
| 784 | exit ;; |
| 785 | sparc*:BSD/OS:*:*) |
| @@ -787,37 +807,39 @@ | |
| 787 | exit ;; |
| 788 | *:BSD/OS:*:*) |
| 789 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
| 790 | exit ;; |
| 791 | *:FreeBSD:*:*) |
| 792 | case ${UNAME_MACHINE} in |
| 793 | pc98) |
| 794 | echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 795 | amd64) |
| 796 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 797 | *) |
| 798 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 799 | esac |
| 800 | exit ;; |
| 801 | i*:CYGWIN*:*) |
| 802 | echo ${UNAME_MACHINE}-pc-cygwin |
| 803 | exit ;; |
| 804 | *:MINGW*:*) |
| 805 | echo ${UNAME_MACHINE}-pc-mingw32 |
| 806 | exit ;; |
| 807 | i*:MSYS*:*) |
| 808 | echo ${UNAME_MACHINE}-pc-msys |
| 809 | exit ;; |
| 810 | i*:windows32*:*) |
| 811 | # uname -m includes "-pc" on this system. |
| 812 | echo ${UNAME_MACHINE}-mingw32 |
| 813 | exit ;; |
| 814 | i*:PW*:*) |
| 815 | echo ${UNAME_MACHINE}-pc-pw32 |
| 816 | exit ;; |
| 817 | *:Interix*:*) |
| 818 | case ${UNAME_MACHINE} in |
| 819 | x86) |
| 820 | echo i586-pc-interix${UNAME_RELEASE} |
| 821 | exit ;; |
| 822 | authenticamd | genuineintel | EM64T) |
| 823 | echo x86_64-unknown-interix${UNAME_RELEASE} |
| @@ -850,74 +872,85 @@ | |
| 850 | prep*:SunOS:5.*:*) |
| 851 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
| 852 | exit ;; |
| 853 | *:GNU:*:*) |
| 854 | # the GNU system |
| 855 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` |
| 856 | exit ;; |
| 857 | *:GNU/*:*:*) |
| 858 | # other systems with GNU libc and userland |
| 859 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu |
| 860 | exit ;; |
| 861 | i*86:Minix:*:*) |
| 862 | echo ${UNAME_MACHINE}-pc-minix |
| 863 | exit ;; |
| 864 | alpha:Linux:*:*) |
| 865 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 866 | EV5) UNAME_MACHINE=alphaev5 ;; |
| 867 | EV56) UNAME_MACHINE=alphaev56 ;; |
| 868 | PCA56) UNAME_MACHINE=alphapca56 ;; |
| 869 | PCA57) UNAME_MACHINE=alphapca56 ;; |
| 870 | EV6) UNAME_MACHINE=alphaev6 ;; |
| 871 | EV67) UNAME_MACHINE=alphaev67 ;; |
| 872 | EV68*) UNAME_MACHINE=alphaev68 ;; |
| 873 | esac |
| 874 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
| 875 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
| 876 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
| 877 | exit ;; |
| 878 | arm*:Linux:*:*) |
| 879 | eval $set_cc_for_build |
| 880 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 881 | | grep -q __ARM_EABI__ |
| 882 | then |
| 883 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 884 | else |
| 885 | echo ${UNAME_MACHINE}-unknown-linux-gnueabi |
| 886 | fi |
| 887 | exit ;; |
| 888 | avr32*:Linux:*:*) |
| 889 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 890 | exit ;; |
| 891 | cris:Linux:*:*) |
| 892 | echo cris-axis-linux-gnu |
| 893 | exit ;; |
| 894 | crisv32:Linux:*:*) |
| 895 | echo crisv32-axis-linux-gnu |
| 896 | exit ;; |
| 897 | frv:Linux:*:*) |
| 898 | echo frv-unknown-linux-gnu |
| 899 | exit ;; |
| 900 | i*86:Linux:*:*) |
| 901 | LIBC=gnu |
| 902 | eval $set_cc_for_build |
| 903 | sed 's/^ //' << EOF >$dummy.c |
| 904 | #ifdef __dietlibc__ |
| 905 | LIBC=dietlibc |
| 906 | #endif |
| 907 | EOF |
| 908 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` |
| 909 | echo "${UNAME_MACHINE}-pc-linux-${LIBC}" |
| 910 | exit ;; |
| 911 | ia64:Linux:*:*) |
| 912 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 913 | exit ;; |
| 914 | m32r*:Linux:*:*) |
| 915 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 916 | exit ;; |
| 917 | m68*:Linux:*:*) |
| 918 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 919 | exit ;; |
| 920 | mips:Linux:*:* | mips64:Linux:*:*) |
| 921 | eval $set_cc_for_build |
| 922 | sed 's/^ //' << EOF >$dummy.c |
| 923 | #undef CPU |
| @@ -932,71 +965,80 @@ | |
| 932 | CPU= |
| 933 | #endif |
| 934 | #endif |
| 935 | EOF |
| 936 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
| 937 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } |
| 938 | ;; |
| 939 | or32:Linux:*:*) |
| 940 | echo or32-unknown-linux-gnu |
| 941 | exit ;; |
| 942 | padre:Linux:*:*) |
| 943 | echo sparc-unknown-linux-gnu |
| 944 | exit ;; |
| 945 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 946 | echo hppa64-unknown-linux-gnu |
| 947 | exit ;; |
| 948 | parisc:Linux:*:* | hppa:Linux:*:*) |
| 949 | # Look for CPU level |
| 950 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
| 951 | PA7*) echo hppa1.1-unknown-linux-gnu ;; |
| 952 | PA8*) echo hppa2.0-unknown-linux-gnu ;; |
| 953 | *) echo hppa-unknown-linux-gnu ;; |
| 954 | esac |
| 955 | exit ;; |
| 956 | ppc64:Linux:*:*) |
| 957 | echo powerpc64-unknown-linux-gnu |
| 958 | exit ;; |
| 959 | ppc:Linux:*:*) |
| 960 | echo powerpc-unknown-linux-gnu |
| 961 | exit ;; |
| 962 | s390:Linux:*:* | s390x:Linux:*:*) |
| 963 | echo ${UNAME_MACHINE}-ibm-linux |
| 964 | exit ;; |
| 965 | sh64*:Linux:*:*) |
| 966 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 967 | exit ;; |
| 968 | sh*:Linux:*:*) |
| 969 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 970 | exit ;; |
| 971 | sparc:Linux:*:* | sparc64:Linux:*:*) |
| 972 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 973 | exit ;; |
| 974 | tile*:Linux:*:*) |
| 975 | echo ${UNAME_MACHINE}-tilera-linux-gnu |
| 976 | exit ;; |
| 977 | vax:Linux:*:*) |
| 978 | echo ${UNAME_MACHINE}-dec-linux-gnu |
| 979 | exit ;; |
| 980 | x86_64:Linux:*:*) |
| 981 | echo x86_64-unknown-linux-gnu |
| 982 | exit ;; |
| 983 | xtensa*:Linux:*:*) |
| 984 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
| 985 | exit ;; |
| 986 | i*86:DYNIX/ptx:4*:*) |
| 987 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
| 988 | # earlier versions are messed up and put the nodename in both |
| 989 | # sysname and nodename. |
| 990 | echo i386-sequent-sysv4 |
| 991 | exit ;; |
| 992 | i*86:UNIX_SV:4.2MP:2.*) |
| 993 | # Unixware is an offshoot of SVR4, but it has its own version |
| 994 | # number series starting with 2... |
| 995 | # I am not positive that other SVR4 systems won't match this, |
| 996 | # I just have to hope. -- rms. |
| 997 | # Use sysv4.2uw... so that sysv4* matches it. |
| 998 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
| 999 | exit ;; |
| 1000 | i*86:OS/2:*:*) |
| 1001 | # If we were able to find `uname', then EMX Unix compatibility |
| 1002 | # is probably installed. |
| @@ -1024,11 +1066,11 @@ | |
| 1024 | else |
| 1025 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
| 1026 | fi |
| 1027 | exit ;; |
| 1028 | i*86:*:5:[678]*) |
| 1029 | # UnixWare 7.x, OpenUNIX and OpenServer 6. |
| 1030 | case `/bin/uname -X | grep "^Machine"` in |
| 1031 | *486*) UNAME_MACHINE=i486 ;; |
| 1032 | *Pentium) UNAME_MACHINE=i586 ;; |
| 1033 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
| 1034 | esac |
| @@ -1052,17 +1094,17 @@ | |
| 1052 | echo ${UNAME_MACHINE}-pc-sysv32 |
| 1053 | fi |
| 1054 | exit ;; |
| 1055 | pc:*:*:*) |
| 1056 | # Left here for compatibility: |
| 1057 | # uname -m prints for DJGPP always 'pc', but it prints nothing about |
| 1058 | # the processor, so we play safe by assuming i586. |
| 1059 | # Note: whatever this is, it MUST be the same as what config.sub |
| 1060 | # prints for the "djgpp" host, or else GDB configury will decide that |
| 1061 | # this is a cross-build. |
| 1062 | echo i586-pc-msdosdjgpp |
| 1063 | exit ;; |
| 1064 | Intel:Mach:3*:*) |
| 1065 | echo i386-pc-mach3 |
| 1066 | exit ;; |
| 1067 | paragon:*:*:*) |
| 1068 | echo i860-intel-osf1 |
| @@ -1093,12 +1135,12 @@ | |
| 1093 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1094 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } |
| 1095 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
| 1096 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; |
| 1097 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) |
| 1098 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1099 | && { echo i486-ncr-sysv4; exit; } ;; |
| 1100 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) |
| 1101 | OS_REL='.3' |
| 1102 | test -r /etc/.relid \ |
| 1103 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
| 1104 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| @@ -1137,14 +1179,14 @@ | |
| 1137 | echo ${UNAME_MACHINE}-sni-sysv4 |
| 1138 | else |
| 1139 | echo ns32k-sni-sysv |
| 1140 | fi |
| 1141 | exit ;; |
| 1142 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort |
| 1143 | # says <[email protected]> |
| 1144 | echo i586-unisys-sysv4 |
| 1145 | exit ;; |
| 1146 | *:UNIX_System_V:4*:FTX*) |
| 1147 | # From Gerald Hewes <[email protected]>. |
| 1148 | # How about differentiating between stratus architectures? -djm |
| 1149 | echo hppa1.1-stratus-sysv4 |
| 1150 | exit ;; |
| @@ -1166,15 +1208,15 @@ | |
| 1166 | news*:NEWS-OS:6*:*) |
| 1167 | echo mips-sony-newsos6 |
| 1168 | exit ;; |
| 1169 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
| 1170 | if [ -d /usr/nec ]; then |
| 1171 | echo mips-nec-sysv${UNAME_RELEASE} |
| 1172 | else |
| 1173 | echo mips-unknown-sysv${UNAME_RELEASE} |
| 1174 | fi |
| 1175 | exit ;; |
| 1176 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
| 1177 | echo powerpc-be-beos |
| 1178 | exit ;; |
| 1179 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. |
| 1180 | echo powerpc-apple-beos |
| @@ -1183,10 +1225,13 @@ | |
| 1183 | echo i586-pc-beos |
| 1184 | exit ;; |
| 1185 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
| 1186 | echo i586-pc-haiku |
| 1187 | exit ;; |
| 1188 | SX-4:SUPER-UX:*:*) |
| 1189 | echo sx4-nec-superux${UNAME_RELEASE} |
| 1190 | exit ;; |
| 1191 | SX-5:SUPER-UX:*:*) |
| 1192 | echo sx5-nec-superux${UNAME_RELEASE} |
| @@ -1209,23 +1254,35 @@ | |
| 1209 | *:Rhapsody:*:*) |
| 1210 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
| 1211 | exit ;; |
| 1212 | *:Darwin:*:*) |
| 1213 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
| 1214 | case $UNAME_PROCESSOR in |
| 1215 | i386) |
| 1216 | eval $set_cc_for_build |
| 1217 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
| 1218 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
| 1219 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
| 1220 | grep IS_64BIT_ARCH >/dev/null |
| 1221 | then |
| 1222 | UNAME_PROCESSOR="x86_64" |
| 1223 | fi |
| 1224 | fi ;; |
| 1225 | unknown) UNAME_PROCESSOR=powerpc ;; |
| 1226 | esac |
| 1227 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
| 1228 | exit ;; |
| 1229 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
| 1230 | UNAME_PROCESSOR=`uname -p` |
| 1231 | if test "$UNAME_PROCESSOR" = "x86"; then |
| @@ -1238,11 +1295,11 @@ | |
| 1238 | echo i386-pc-qnx |
| 1239 | exit ;; |
| 1240 | NEO-?:NONSTOP_KERNEL:*:*) |
| 1241 | echo neo-tandem-nsk${UNAME_RELEASE} |
| 1242 | exit ;; |
| 1243 | NSE-?:NONSTOP_KERNEL:*:*) |
| 1244 | echo nse-tandem-nsk${UNAME_RELEASE} |
| 1245 | exit ;; |
| 1246 | NSR-?:NONSTOP_KERNEL:*:*) |
| 1247 | echo nsr-tandem-nsk${UNAME_RELEASE} |
| 1248 | exit ;; |
| @@ -1283,17 +1340,17 @@ | |
| 1283 | exit ;; |
| 1284 | *:ITS:*:*) |
| 1285 | echo pdp10-unknown-its |
| 1286 | exit ;; |
| 1287 | SEI:*:*:SEIUX) |
| 1288 | echo mips-sei-seiux${UNAME_RELEASE} |
| 1289 | exit ;; |
| 1290 | *:DragonFly:*:*) |
| 1291 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
| 1292 | exit ;; |
| 1293 | *:*VMS:*:*) |
| 1294 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
| 1295 | case "${UNAME_MACHINE}" in |
| 1296 | A*) echo alpha-dec-vms ; exit ;; |
| 1297 | I*) echo ia64-dec-vms ; exit ;; |
| 1298 | V*) echo vax-dec-vms ; exit ;; |
| 1299 | esac ;; |
| @@ -1307,162 +1364,14 @@ | |
| 1307 | echo ${UNAME_MACHINE}-pc-rdos |
| 1308 | exit ;; |
| 1309 | i*86:AROS:*:*) |
| 1310 | echo ${UNAME_MACHINE}-pc-aros |
| 1311 | exit ;; |
| 1312 | esac |
| 1313 | |
| 1314 | #echo '(No uname command or uname output not recognized.)' 1>&2 |
| 1315 | #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 |
| 1316 | |
| 1317 | eval $set_cc_for_build |
| 1318 | cat >$dummy.c <<EOF |
| 1319 | #ifdef _SEQUENT_ |
| 1320 | # include <sys/types.h> |
| 1321 | # include <sys/utsname.h> |
| 1322 | #endif |
| 1323 | main () |
| 1324 | { |
| 1325 | #if defined (sony) |
| 1326 | #if defined (MIPSEB) |
| 1327 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, |
| 1328 | I don't know.... */ |
| 1329 | printf ("mips-sony-bsd\n"); exit (0); |
| 1330 | #else |
| 1331 | #include <sys/param.h> |
| 1332 | printf ("m68k-sony-newsos%s\n", |
| 1333 | #ifdef NEWSOS4 |
| 1334 | "4" |
| 1335 | #else |
| 1336 | "" |
| 1337 | #endif |
| 1338 | ); exit (0); |
| 1339 | #endif |
| 1340 | #endif |
| 1341 | |
| 1342 | #if defined (__arm) && defined (__acorn) && defined (__unix) |
| 1343 | printf ("arm-acorn-riscix\n"); exit (0); |
| 1344 | #endif |
| 1345 | |
| 1346 | #if defined (hp300) && !defined (hpux) |
| 1347 | printf ("m68k-hp-bsd\n"); exit (0); |
| 1348 | #endif |
| 1349 | |
| 1350 | #if defined (NeXT) |
| 1351 | #if !defined (__ARCHITECTURE__) |
| 1352 | #define __ARCHITECTURE__ "m68k" |
| 1353 | #endif |
| 1354 | int version; |
| 1355 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; |
| 1356 | if (version < 4) |
| 1357 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); |
| 1358 | else |
| 1359 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); |
| 1360 | exit (0); |
| 1361 | #endif |
| 1362 | |
| 1363 | #if defined (MULTIMAX) || defined (n16) |
| 1364 | #if defined (UMAXV) |
| 1365 | printf ("ns32k-encore-sysv\n"); exit (0); |
| 1366 | #else |
| 1367 | #if defined (CMU) |
| 1368 | printf ("ns32k-encore-mach\n"); exit (0); |
| 1369 | #else |
| 1370 | printf ("ns32k-encore-bsd\n"); exit (0); |
| 1371 | #endif |
| 1372 | #endif |
| 1373 | #endif |
| 1374 | |
| 1375 | #if defined (__386BSD__) |
| 1376 | printf ("i386-pc-bsd\n"); exit (0); |
| 1377 | #endif |
| 1378 | |
| 1379 | #if defined (sequent) |
| 1380 | #if defined (i386) |
| 1381 | printf ("i386-sequent-dynix\n"); exit (0); |
| 1382 | #endif |
| 1383 | #if defined (ns32000) |
| 1384 | printf ("ns32k-sequent-dynix\n"); exit (0); |
| 1385 | #endif |
| 1386 | #endif |
| 1387 | |
| 1388 | #if defined (_SEQUENT_) |
| 1389 | struct utsname un; |
| 1390 | |
| 1391 | uname(&un); |
| 1392 | |
| 1393 | if (strncmp(un.version, "V2", 2) == 0) { |
| 1394 | printf ("i386-sequent-ptx2\n"); exit (0); |
| 1395 | } |
| 1396 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ |
| 1397 | printf ("i386-sequent-ptx1\n"); exit (0); |
| 1398 | } |
| 1399 | printf ("i386-sequent-ptx\n"); exit (0); |
| 1400 | |
| 1401 | #endif |
| 1402 | |
| 1403 | #if defined (vax) |
| 1404 | # if !defined (ultrix) |
| 1405 | # include <sys/param.h> |
| 1406 | # if defined (BSD) |
| 1407 | # if BSD == 43 |
| 1408 | printf ("vax-dec-bsd4.3\n"); exit (0); |
| 1409 | # else |
| 1410 | # if BSD == 199006 |
| 1411 | printf ("vax-dec-bsd4.3reno\n"); exit (0); |
| 1412 | # else |
| 1413 | printf ("vax-dec-bsd\n"); exit (0); |
| 1414 | # endif |
| 1415 | # endif |
| 1416 | # else |
| 1417 | printf ("vax-dec-bsd\n"); exit (0); |
| 1418 | # endif |
| 1419 | # else |
| 1420 | printf ("vax-dec-ultrix\n"); exit (0); |
| 1421 | # endif |
| 1422 | #endif |
| 1423 | |
| 1424 | #if defined (alliant) && defined (i860) |
| 1425 | printf ("i860-alliant-bsd\n"); exit (0); |
| 1426 | #endif |
| 1427 | |
| 1428 | exit (1); |
| 1429 | } |
| 1430 | EOF |
| 1431 | |
| 1432 | $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && |
| 1433 | { echo "$SYSTEM_NAME"; exit; } |
| 1434 | |
| 1435 | # Apollos put the system type in the environment. |
| 1436 | |
| 1437 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } |
| 1438 | |
| 1439 | # Convex versions that predate uname can use getsysinfo(1) |
| 1440 | |
| 1441 | if [ -x /usr/convex/getsysinfo ] |
| 1442 | then |
| 1443 | case `getsysinfo -f cpu_type` in |
| 1444 | c1*) |
| 1445 | echo c1-convex-bsd |
| 1446 | exit ;; |
| 1447 | c2*) |
| 1448 | if getsysinfo -f scalar_acc |
| 1449 | then echo c32-convex-bsd |
| 1450 | else echo c2-convex-bsd |
| 1451 | fi |
| 1452 | exit ;; |
| 1453 | c34*) |
| 1454 | echo c34-convex-bsd |
| 1455 | exit ;; |
| 1456 | c38*) |
| 1457 | echo c38-convex-bsd |
| 1458 | exit ;; |
| 1459 | c4*) |
| 1460 | echo c4-convex-bsd |
| 1461 | exit ;; |
| 1462 | esac |
| 1463 | fi |
| 1464 | |
| 1465 | cat >&2 <<EOF |
| 1466 | $0: unable to guess system type |
| 1467 | |
| 1468 | This script, last modified $timestamp, has failed to recognize |
| 1469 |
| --- autosetup/config.guess | |
| +++ autosetup/config.guess | |
| @@ -1,44 +1,38 @@ | |
| 1 | #! /bin/sh |
| 2 | # Attempt to guess a canonical system name. |
| 3 | # Copyright 1992-2014 Free Software Foundation, Inc. |
| 4 | |
| 5 | timestamp='2014-03-23' |
| 6 | |
| 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, but |
| 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | # General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 19 | # |
| 20 | # As a special exception to the GNU General Public License, if you |
| 21 | # distribute this file as part of a program that contains a |
| 22 | # configuration script generated by Autoconf, you may include it under |
| 23 | # the same distribution terms that you use for the rest of that |
| 24 | # program. This Exception is an additional permission under section 7 |
| 25 | # of the GNU General Public License, version 3 ("GPLv3"). |
| 26 | # |
| 27 | # Originally written by Per Bothner. |
| 28 | # |
| 29 | # You can get the latest version of this script from: |
| 30 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
| 31 | # |
| 32 | # Please send patches with a ChangeLog entry to [email protected]. |
| 33 | |
| 34 | |
| 35 | me=`echo "$0" | sed -e 's,.*/,,'` |
| 36 | |
| 37 | usage="\ |
| 38 | Usage: $0 [OPTION] |
| @@ -54,13 +48,11 @@ | |
| 48 | |
| 49 | version="\ |
| 50 | GNU config.guess ($timestamp) |
| 51 | |
| 52 | Originally written by Per Bothner. |
| 53 | Copyright 1992-2014 Free Software Foundation, Inc. |
| 54 | |
| 55 | This is free software; see the source for copying conditions. There is NO |
| 56 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 57 | |
| 58 | help=" |
| @@ -90,11 +82,11 @@ | |
| 82 | if test $# != 0; then |
| 83 | echo "$me: too many arguments$help" >&2 |
| 84 | exit 1 |
| 85 | fi |
| 86 | |
| 87 | trap 'exit 1' 1 2 15 |
| 88 | |
| 89 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
| 90 | # compiler to aid in system detection is discouraged as it requires |
| 91 | # temporary files to be created and, as you can see below, it is a |
| 92 | # headache to deal with in a portable fashion. |
| @@ -104,11 +96,11 @@ | |
| 96 | |
| 97 | # Portable tmp directory creation inspired by the Autoconf team. |
| 98 | |
| 99 | set_cc_for_build=' |
| 100 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
| 101 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; |
| 102 | : ${TMPDIR=/tmp} ; |
| 103 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 104 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 105 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
| 106 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
| @@ -137,17 +129,38 @@ | |
| 129 | |
| 130 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
| 131 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
| 132 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
| 133 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
| 134 | |
| 135 | case "${UNAME_SYSTEM}" in |
| 136 | Linux|GNU|GNU/*) |
| 137 | # If the system lacks a compiler, then just pick glibc. |
| 138 | # We could probably try harder. |
| 139 | LIBC=gnu |
| 140 | |
| 141 | eval $set_cc_for_build |
| 142 | cat <<-EOF > $dummy.c |
| 143 | #include <features.h> |
| 144 | #if defined(__UCLIBC__) |
| 145 | LIBC=uclibc |
| 146 | #elif defined(__dietlibc__) |
| 147 | LIBC=dietlibc |
| 148 | #else |
| 149 | LIBC=gnu |
| 150 | #endif |
| 151 | EOF |
| 152 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` |
| 153 | ;; |
| 154 | esac |
| 155 | |
| 156 | # Note: order is significant - the case branches are not exclusive. |
| 157 | |
| 158 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
| 159 | *:NetBSD:*:*) |
| 160 | # NetBSD (nbsd) targets should (where applicable) match one or |
| 161 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, |
| 162 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
| 163 | # switched to ELF, *-*-netbsd* would select the old |
| 164 | # object file format. This provides both forward |
| 165 | # compatibility and a consistent mechanism for selecting the |
| 166 | # object file format. |
| @@ -179,11 +192,11 @@ | |
| 192 | else |
| 193 | os=netbsdelf |
| 194 | fi |
| 195 | ;; |
| 196 | *) |
| 197 | os=netbsd |
| 198 | ;; |
| 199 | esac |
| 200 | # The OS release |
| 201 | # Debian GNU/NetBSD machines have a different userland, and |
| 202 | # thus, need a distinct triplet. However, they do not need |
| @@ -200,10 +213,14 @@ | |
| 213 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
| 214 | # contains redundant information, the shorter form: |
| 215 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
| 216 | echo "${machine}-${os}${release}" |
| 217 | exit ;; |
| 218 | *:Bitrig:*:*) |
| 219 | UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` |
| 220 | echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} |
| 221 | exit ;; |
| 222 | *:OpenBSD:*:*) |
| 223 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
| 224 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
| 225 | exit ;; |
| 226 | *:ekkoBSD:*:*) |
| @@ -222,11 +239,11 @@ | |
| 239 | case $UNAME_RELEASE in |
| 240 | *4.0) |
| 241 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
| 242 | ;; |
| 243 | *5.*) |
| 244 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` |
| 245 | ;; |
| 246 | esac |
| 247 | # According to Compaq, /usr/sbin/psrinfo has been available on |
| 248 | # OSF/1 and Tru64 systems produced since 1995. I hope that |
| 249 | # covers most systems running today. This code pipes the CPU |
| @@ -268,11 +285,14 @@ | |
| 285 | # A Vn.n version is a released version. |
| 286 | # A Tn.n version is a released field test version. |
| 287 | # A Xn.n version is an unreleased experimental baselevel. |
| 288 | # 1.2 uses "1.2" for uname -r. |
| 289 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 290 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. |
| 291 | exitcode=$? |
| 292 | trap '' 0 |
| 293 | exit $exitcode ;; |
| 294 | Alpha\ *:Windows_NT*:*) |
| 295 | # How do we know it's Interix rather than the generic POSIX subsystem? |
| 296 | # Should we change UNAME_MACHINE based on the output of uname instead |
| 297 | # of the specific Alpha model? |
| 298 | echo alpha-pc-interix |
| @@ -294,16 +314,16 @@ | |
| 314 | exit ;; |
| 315 | *:z/VM:*:*) |
| 316 | echo s390-ibm-zvmoe |
| 317 | exit ;; |
| 318 | *:OS400:*:*) |
| 319 | echo powerpc-ibm-os400 |
| 320 | exit ;; |
| 321 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
| 322 | echo arm-acorn-riscix${UNAME_RELEASE} |
| 323 | exit ;; |
| 324 | arm*:riscos:*:*|arm*:RISCOS:*:*) |
| 325 | echo arm-unknown-riscos |
| 326 | exit ;; |
| 327 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
| 328 | echo hppa1.1-hitachi-hiuxmpp |
| 329 | exit ;; |
| @@ -393,27 +413,27 @@ | |
| 413 | # to the lowercase version "mint" (or "freemint"). Finally |
| 414 | # the system name "TOS" denotes a system which is actually not |
| 415 | # MiNT. But MiNT is downward compatible to TOS, so this should |
| 416 | # be no problem. |
| 417 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
| 418 | echo m68k-atari-mint${UNAME_RELEASE} |
| 419 | exit ;; |
| 420 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
| 421 | echo m68k-atari-mint${UNAME_RELEASE} |
| 422 | exit ;; |
| 423 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
| 424 | echo m68k-atari-mint${UNAME_RELEASE} |
| 425 | exit ;; |
| 426 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
| 427 | echo m68k-milan-mint${UNAME_RELEASE} |
| 428 | exit ;; |
| 429 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
| 430 | echo m68k-hades-mint${UNAME_RELEASE} |
| 431 | exit ;; |
| 432 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
| 433 | echo m68k-unknown-mint${UNAME_RELEASE} |
| 434 | exit ;; |
| 435 | m68k:machten:*:*) |
| 436 | echo m68k-apple-machten${UNAME_RELEASE} |
| 437 | exit ;; |
| 438 | powerpc:machten:*:*) |
| 439 | echo powerpc-apple-machten${UNAME_RELEASE} |
| @@ -479,12 +499,12 @@ | |
| 499 | exit ;; |
| 500 | m88k:*:3*:R3*) |
| 501 | echo m88k-motorola-sysv3 |
| 502 | exit ;; |
| 503 | AViiON:dgux:*:*) |
| 504 | # DG/UX returns AViiON for all architectures |
| 505 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
| 506 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] |
| 507 | then |
| 508 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ |
| 509 | [ ${TARGET_BINARY_INTERFACE}x = x ] |
| 510 | then |
| @@ -493,11 +513,11 @@ | |
| 513 | echo m88k-dg-dguxbcs${UNAME_RELEASE} |
| 514 | fi |
| 515 | else |
| 516 | echo i586-dg-dgux${UNAME_RELEASE} |
| 517 | fi |
| 518 | exit ;; |
| 519 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
| 520 | echo m88k-dolphin-sysv3 |
| 521 | exit ;; |
| 522 | M88*:*:R3*:*) |
| 523 | # Delta 88k system running SVR3 |
| @@ -593,56 +613,56 @@ | |
| 613 | 9000/31? ) HP_ARCH=m68000 ;; |
| 614 | 9000/[34]?? ) HP_ARCH=m68k ;; |
| 615 | 9000/[678][0-9][0-9]) |
| 616 | if [ -x /usr/bin/getconf ]; then |
| 617 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
| 618 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` |
| 619 | case "${sc_cpu_version}" in |
| 620 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 |
| 621 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 |
| 622 | 532) # CPU_PA_RISC2_0 |
| 623 | case "${sc_kernel_bits}" in |
| 624 | 32) HP_ARCH="hppa2.0n" ;; |
| 625 | 64) HP_ARCH="hppa2.0w" ;; |
| 626 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 |
| 627 | esac ;; |
| 628 | esac |
| 629 | fi |
| 630 | if [ "${HP_ARCH}" = "" ]; then |
| 631 | eval $set_cc_for_build |
| 632 | sed 's/^ //' << EOF >$dummy.c |
| 633 | |
| 634 | #define _HPUX_SOURCE |
| 635 | #include <stdlib.h> |
| 636 | #include <unistd.h> |
| 637 | |
| 638 | int main () |
| 639 | { |
| 640 | #if defined(_SC_KERNEL_BITS) |
| 641 | long bits = sysconf(_SC_KERNEL_BITS); |
| 642 | #endif |
| 643 | long cpu = sysconf (_SC_CPU_VERSION); |
| 644 | |
| 645 | switch (cpu) |
| 646 | { |
| 647 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; |
| 648 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; |
| 649 | case CPU_PA_RISC2_0: |
| 650 | #if defined(_SC_KERNEL_BITS) |
| 651 | switch (bits) |
| 652 | { |
| 653 | case 64: puts ("hppa2.0w"); break; |
| 654 | case 32: puts ("hppa2.0n"); break; |
| 655 | default: puts ("hppa2.0"); break; |
| 656 | } break; |
| 657 | #else /* !defined(_SC_KERNEL_BITS) */ |
| 658 | puts ("hppa2.0"); break; |
| 659 | #endif |
| 660 | default: puts ("hppa1.0"); break; |
| 661 | } |
| 662 | exit (0); |
| 663 | } |
| 664 | EOF |
| 665 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` |
| 666 | test -z "$HP_ARCH" && HP_ARCH=hppa |
| 667 | fi ;; |
| 668 | esac |
| @@ -729,26 +749,26 @@ | |
| 749 | parisc*:Lites*:*:*) |
| 750 | echo hppa1.1-hp-lites |
| 751 | exit ;; |
| 752 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) |
| 753 | echo c1-convex-bsd |
| 754 | exit ;; |
| 755 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) |
| 756 | if getsysinfo -f scalar_acc |
| 757 | then echo c32-convex-bsd |
| 758 | else echo c2-convex-bsd |
| 759 | fi |
| 760 | exit ;; |
| 761 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) |
| 762 | echo c34-convex-bsd |
| 763 | exit ;; |
| 764 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) |
| 765 | echo c38-convex-bsd |
| 766 | exit ;; |
| 767 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) |
| 768 | echo c4-convex-bsd |
| 769 | exit ;; |
| 770 | CRAY*Y-MP:*:*:*) |
| 771 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 772 | exit ;; |
| 773 | CRAY*[A-Z]90:*:*:*) |
| 774 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ |
| @@ -768,18 +788,18 @@ | |
| 788 | *:UNICOS/mp:*:*) |
| 789 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 790 | exit ;; |
| 791 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
| 792 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
| 793 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
| 794 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` |
| 795 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
| 796 | exit ;; |
| 797 | 5000:UNIX_System_V:4.*:*) |
| 798 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
| 799 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` |
| 800 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
| 801 | exit ;; |
| 802 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
| 803 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} |
| 804 | exit ;; |
| 805 | sparc*:BSD/OS:*:*) |
| @@ -787,37 +807,39 @@ | |
| 807 | exit ;; |
| 808 | *:BSD/OS:*:*) |
| 809 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
| 810 | exit ;; |
| 811 | *:FreeBSD:*:*) |
| 812 | UNAME_PROCESSOR=`/usr/bin/uname -p` |
| 813 | case ${UNAME_PROCESSOR} in |
| 814 | amd64) |
| 815 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 816 | *) |
| 817 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 818 | esac |
| 819 | exit ;; |
| 820 | i*:CYGWIN*:*) |
| 821 | echo ${UNAME_MACHINE}-pc-cygwin |
| 822 | exit ;; |
| 823 | *:MINGW64*:*) |
| 824 | echo ${UNAME_MACHINE}-pc-mingw64 |
| 825 | exit ;; |
| 826 | *:MINGW*:*) |
| 827 | echo ${UNAME_MACHINE}-pc-mingw32 |
| 828 | exit ;; |
| 829 | *:MSYS*:*) |
| 830 | echo ${UNAME_MACHINE}-pc-msys |
| 831 | exit ;; |
| 832 | i*:windows32*:*) |
| 833 | # uname -m includes "-pc" on this system. |
| 834 | echo ${UNAME_MACHINE}-mingw32 |
| 835 | exit ;; |
| 836 | i*:PW*:*) |
| 837 | echo ${UNAME_MACHINE}-pc-pw32 |
| 838 | exit ;; |
| 839 | *:Interix*:*) |
| 840 | case ${UNAME_MACHINE} in |
| 841 | x86) |
| 842 | echo i586-pc-interix${UNAME_RELEASE} |
| 843 | exit ;; |
| 844 | authenticamd | genuineintel | EM64T) |
| 845 | echo x86_64-unknown-interix${UNAME_RELEASE} |
| @@ -850,74 +872,85 @@ | |
| 872 | prep*:SunOS:5.*:*) |
| 873 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
| 874 | exit ;; |
| 875 | *:GNU:*:*) |
| 876 | # the GNU system |
| 877 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` |
| 878 | exit ;; |
| 879 | *:GNU/*:*:*) |
| 880 | # other systems with GNU libc and userland |
| 881 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} |
| 882 | exit ;; |
| 883 | i*86:Minix:*:*) |
| 884 | echo ${UNAME_MACHINE}-pc-minix |
| 885 | exit ;; |
| 886 | aarch64:Linux:*:*) |
| 887 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 888 | exit ;; |
| 889 | aarch64_be:Linux:*:*) |
| 890 | UNAME_MACHINE=aarch64_be |
| 891 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 892 | exit ;; |
| 893 | alpha:Linux:*:*) |
| 894 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 895 | EV5) UNAME_MACHINE=alphaev5 ;; |
| 896 | EV56) UNAME_MACHINE=alphaev56 ;; |
| 897 | PCA56) UNAME_MACHINE=alphapca56 ;; |
| 898 | PCA57) UNAME_MACHINE=alphapca56 ;; |
| 899 | EV6) UNAME_MACHINE=alphaev6 ;; |
| 900 | EV67) UNAME_MACHINE=alphaev67 ;; |
| 901 | EV68*) UNAME_MACHINE=alphaev68 ;; |
| 902 | esac |
| 903 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
| 904 | if test "$?" = 0 ; then LIBC="gnulibc1" ; fi |
| 905 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 906 | exit ;; |
| 907 | arc:Linux:*:* | arceb:Linux:*:*) |
| 908 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 909 | exit ;; |
| 910 | arm*:Linux:*:*) |
| 911 | eval $set_cc_for_build |
| 912 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 913 | | grep -q __ARM_EABI__ |
| 914 | then |
| 915 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 916 | else |
| 917 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 918 | | grep -q __ARM_PCS_VFP |
| 919 | then |
| 920 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi |
| 921 | else |
| 922 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf |
| 923 | fi |
| 924 | fi |
| 925 | exit ;; |
| 926 | avr32*:Linux:*:*) |
| 927 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 928 | exit ;; |
| 929 | cris:Linux:*:*) |
| 930 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} |
| 931 | exit ;; |
| 932 | crisv32:Linux:*:*) |
| 933 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} |
| 934 | exit ;; |
| 935 | frv:Linux:*:*) |
| 936 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 937 | exit ;; |
| 938 | hexagon:Linux:*:*) |
| 939 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 940 | exit ;; |
| 941 | i*86:Linux:*:*) |
| 942 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} |
| 943 | exit ;; |
| 944 | ia64:Linux:*:*) |
| 945 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 946 | exit ;; |
| 947 | m32r*:Linux:*:*) |
| 948 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 949 | exit ;; |
| 950 | m68*:Linux:*:*) |
| 951 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 952 | exit ;; |
| 953 | mips:Linux:*:* | mips64:Linux:*:*) |
| 954 | eval $set_cc_for_build |
| 955 | sed 's/^ //' << EOF >$dummy.c |
| 956 | #undef CPU |
| @@ -932,71 +965,80 @@ | |
| 965 | CPU= |
| 966 | #endif |
| 967 | #endif |
| 968 | EOF |
| 969 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
| 970 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
| 971 | ;; |
| 972 | openrisc*:Linux:*:*) |
| 973 | echo or1k-unknown-linux-${LIBC} |
| 974 | exit ;; |
| 975 | or32:Linux:*:* | or1k*:Linux:*:*) |
| 976 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 977 | exit ;; |
| 978 | padre:Linux:*:*) |
| 979 | echo sparc-unknown-linux-${LIBC} |
| 980 | exit ;; |
| 981 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 982 | echo hppa64-unknown-linux-${LIBC} |
| 983 | exit ;; |
| 984 | parisc:Linux:*:* | hppa:Linux:*:*) |
| 985 | # Look for CPU level |
| 986 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
| 987 | PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; |
| 988 | PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; |
| 989 | *) echo hppa-unknown-linux-${LIBC} ;; |
| 990 | esac |
| 991 | exit ;; |
| 992 | ppc64:Linux:*:*) |
| 993 | echo powerpc64-unknown-linux-${LIBC} |
| 994 | exit ;; |
| 995 | ppc:Linux:*:*) |
| 996 | echo powerpc-unknown-linux-${LIBC} |
| 997 | exit ;; |
| 998 | ppc64le:Linux:*:*) |
| 999 | echo powerpc64le-unknown-linux-${LIBC} |
| 1000 | exit ;; |
| 1001 | ppcle:Linux:*:*) |
| 1002 | echo powerpcle-unknown-linux-${LIBC} |
| 1003 | exit ;; |
| 1004 | s390:Linux:*:* | s390x:Linux:*:*) |
| 1005 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} |
| 1006 | exit ;; |
| 1007 | sh64*:Linux:*:*) |
| 1008 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1009 | exit ;; |
| 1010 | sh*:Linux:*:*) |
| 1011 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1012 | exit ;; |
| 1013 | sparc:Linux:*:* | sparc64:Linux:*:*) |
| 1014 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1015 | exit ;; |
| 1016 | tile*:Linux:*:*) |
| 1017 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1018 | exit ;; |
| 1019 | vax:Linux:*:*) |
| 1020 | echo ${UNAME_MACHINE}-dec-linux-${LIBC} |
| 1021 | exit ;; |
| 1022 | x86_64:Linux:*:*) |
| 1023 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1024 | exit ;; |
| 1025 | xtensa*:Linux:*:*) |
| 1026 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1027 | exit ;; |
| 1028 | i*86:DYNIX/ptx:4*:*) |
| 1029 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
| 1030 | # earlier versions are messed up and put the nodename in both |
| 1031 | # sysname and nodename. |
| 1032 | echo i386-sequent-sysv4 |
| 1033 | exit ;; |
| 1034 | i*86:UNIX_SV:4.2MP:2.*) |
| 1035 | # Unixware is an offshoot of SVR4, but it has its own version |
| 1036 | # number series starting with 2... |
| 1037 | # I am not positive that other SVR4 systems won't match this, |
| 1038 | # I just have to hope. -- rms. |
| 1039 | # Use sysv4.2uw... so that sysv4* matches it. |
| 1040 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
| 1041 | exit ;; |
| 1042 | i*86:OS/2:*:*) |
| 1043 | # If we were able to find `uname', then EMX Unix compatibility |
| 1044 | # is probably installed. |
| @@ -1024,11 +1066,11 @@ | |
| 1066 | else |
| 1067 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
| 1068 | fi |
| 1069 | exit ;; |
| 1070 | i*86:*:5:[678]*) |
| 1071 | # UnixWare 7.x, OpenUNIX and OpenServer 6. |
| 1072 | case `/bin/uname -X | grep "^Machine"` in |
| 1073 | *486*) UNAME_MACHINE=i486 ;; |
| 1074 | *Pentium) UNAME_MACHINE=i586 ;; |
| 1075 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
| 1076 | esac |
| @@ -1052,17 +1094,17 @@ | |
| 1094 | echo ${UNAME_MACHINE}-pc-sysv32 |
| 1095 | fi |
| 1096 | exit ;; |
| 1097 | pc:*:*:*) |
| 1098 | # Left here for compatibility: |
| 1099 | # uname -m prints for DJGPP always 'pc', but it prints nothing about |
| 1100 | # the processor, so we play safe by assuming i586. |
| 1101 | # Note: whatever this is, it MUST be the same as what config.sub |
| 1102 | # prints for the "djgpp" host, or else GDB configury will decide that |
| 1103 | # this is a cross-build. |
| 1104 | echo i586-pc-msdosdjgpp |
| 1105 | exit ;; |
| 1106 | Intel:Mach:3*:*) |
| 1107 | echo i386-pc-mach3 |
| 1108 | exit ;; |
| 1109 | paragon:*:*:*) |
| 1110 | echo i860-intel-osf1 |
| @@ -1093,12 +1135,12 @@ | |
| 1135 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1136 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } |
| 1137 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
| 1138 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; |
| 1139 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) |
| 1140 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1141 | && { echo i486-ncr-sysv4; exit; } ;; |
| 1142 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) |
| 1143 | OS_REL='.3' |
| 1144 | test -r /etc/.relid \ |
| 1145 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
| 1146 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| @@ -1137,14 +1179,14 @@ | |
| 1179 | echo ${UNAME_MACHINE}-sni-sysv4 |
| 1180 | else |
| 1181 | echo ns32k-sni-sysv |
| 1182 | fi |
| 1183 | exit ;; |
| 1184 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort |
| 1185 | # says <[email protected]> |
| 1186 | echo i586-unisys-sysv4 |
| 1187 | exit ;; |
| 1188 | *:UNIX_System_V:4*:FTX*) |
| 1189 | # From Gerald Hewes <[email protected]>. |
| 1190 | # How about differentiating between stratus architectures? -djm |
| 1191 | echo hppa1.1-stratus-sysv4 |
| 1192 | exit ;; |
| @@ -1166,15 +1208,15 @@ | |
| 1208 | news*:NEWS-OS:6*:*) |
| 1209 | echo mips-sony-newsos6 |
| 1210 | exit ;; |
| 1211 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
| 1212 | if [ -d /usr/nec ]; then |
| 1213 | echo mips-nec-sysv${UNAME_RELEASE} |
| 1214 | else |
| 1215 | echo mips-unknown-sysv${UNAME_RELEASE} |
| 1216 | fi |
| 1217 | exit ;; |
| 1218 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
| 1219 | echo powerpc-be-beos |
| 1220 | exit ;; |
| 1221 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. |
| 1222 | echo powerpc-apple-beos |
| @@ -1183,10 +1225,13 @@ | |
| 1225 | echo i586-pc-beos |
| 1226 | exit ;; |
| 1227 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
| 1228 | echo i586-pc-haiku |
| 1229 | exit ;; |
| 1230 | x86_64:Haiku:*:*) |
| 1231 | echo x86_64-unknown-haiku |
| 1232 | exit ;; |
| 1233 | SX-4:SUPER-UX:*:*) |
| 1234 | echo sx4-nec-superux${UNAME_RELEASE} |
| 1235 | exit ;; |
| 1236 | SX-5:SUPER-UX:*:*) |
| 1237 | echo sx5-nec-superux${UNAME_RELEASE} |
| @@ -1209,23 +1254,35 @@ | |
| 1254 | *:Rhapsody:*:*) |
| 1255 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
| 1256 | exit ;; |
| 1257 | *:Darwin:*:*) |
| 1258 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
| 1259 | eval $set_cc_for_build |
| 1260 | if test "$UNAME_PROCESSOR" = unknown ; then |
| 1261 | UNAME_PROCESSOR=powerpc |
| 1262 | fi |
| 1263 | if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then |
| 1264 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
| 1265 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
| 1266 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
| 1267 | grep IS_64BIT_ARCH >/dev/null |
| 1268 | then |
| 1269 | case $UNAME_PROCESSOR in |
| 1270 | i386) UNAME_PROCESSOR=x86_64 ;; |
| 1271 | powerpc) UNAME_PROCESSOR=powerpc64 ;; |
| 1272 | esac |
| 1273 | fi |
| 1274 | fi |
| 1275 | elif test "$UNAME_PROCESSOR" = i386 ; then |
| 1276 | # Avoid executing cc on OS X 10.9, as it ships with a stub |
| 1277 | # that puts up a graphical alert prompting to install |
| 1278 | # developer tools. Any system running Mac OS X 10.7 or |
| 1279 | # later (Darwin 11 and later) is required to have a 64-bit |
| 1280 | # processor. This is not true of the ARM version of Darwin |
| 1281 | # that Apple uses in portable devices. |
| 1282 | UNAME_PROCESSOR=x86_64 |
| 1283 | fi |
| 1284 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
| 1285 | exit ;; |
| 1286 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
| 1287 | UNAME_PROCESSOR=`uname -p` |
| 1288 | if test "$UNAME_PROCESSOR" = "x86"; then |
| @@ -1238,11 +1295,11 @@ | |
| 1295 | echo i386-pc-qnx |
| 1296 | exit ;; |
| 1297 | NEO-?:NONSTOP_KERNEL:*:*) |
| 1298 | echo neo-tandem-nsk${UNAME_RELEASE} |
| 1299 | exit ;; |
| 1300 | NSE-*:NONSTOP_KERNEL:*:*) |
| 1301 | echo nse-tandem-nsk${UNAME_RELEASE} |
| 1302 | exit ;; |
| 1303 | NSR-?:NONSTOP_KERNEL:*:*) |
| 1304 | echo nsr-tandem-nsk${UNAME_RELEASE} |
| 1305 | exit ;; |
| @@ -1283,17 +1340,17 @@ | |
| 1340 | exit ;; |
| 1341 | *:ITS:*:*) |
| 1342 | echo pdp10-unknown-its |
| 1343 | exit ;; |
| 1344 | SEI:*:*:SEIUX) |
| 1345 | echo mips-sei-seiux${UNAME_RELEASE} |
| 1346 | exit ;; |
| 1347 | *:DragonFly:*:*) |
| 1348 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
| 1349 | exit ;; |
| 1350 | *:*VMS:*:*) |
| 1351 | UNAME_MACHINE=`(uname -p) 2>/dev/null` |
| 1352 | case "${UNAME_MACHINE}" in |
| 1353 | A*) echo alpha-dec-vms ; exit ;; |
| 1354 | I*) echo ia64-dec-vms ; exit ;; |
| 1355 | V*) echo vax-dec-vms ; exit ;; |
| 1356 | esac ;; |
| @@ -1307,162 +1364,14 @@ | |
| 1364 | echo ${UNAME_MACHINE}-pc-rdos |
| 1365 | exit ;; |
| 1366 | i*86:AROS:*:*) |
| 1367 | echo ${UNAME_MACHINE}-pc-aros |
| 1368 | exit ;; |
| 1369 | x86_64:VMkernel:*:*) |
| 1370 | echo ${UNAME_MACHINE}-unknown-esx |
| 1371 | exit ;; |
| 1372 | esac |
| 1373 | |
| 1374 | cat >&2 <<EOF |
| 1375 | $0: unable to guess system type |
| 1376 | |
| 1377 | This script, last modified $timestamp, has failed to recognize |
| 1378 |
+154
-103
| --- autosetup/config.sub | ||
| +++ autosetup/config.sub | ||
| @@ -1,40 +1,33 @@ | ||
| 1 | 1 | #! /bin/sh |
| 2 | 2 | # Configuration validation subroutine script. |
| 3 | -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | |
| 4 | -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | |
| 5 | -# Free Software Foundation, Inc. | |
| 6 | - | |
| 7 | -timestamp='2010-09-11' | |
| 8 | - | |
| 9 | -# This file is (in principle) common to ALL GNU software. | |
| 10 | -# The presence of a machine in this file suggests that SOME GNU software | |
| 11 | -# can handle that machine. It does not imply ALL GNU software can. | |
| 12 | -# | |
| 13 | -# This file is free software; you can redistribute it and/or modify | |
| 14 | -# it under the terms of the GNU General Public License as published by | |
| 15 | -# the Free Software Foundation; either version 2 of the License, or | |
| 3 | +# Copyright 1992-2014 Free Software Foundation, Inc. | |
| 4 | + | |
| 5 | +timestamp='2014-05-01' | |
| 6 | + | |
| 7 | +# This file is free software; you can redistribute it and/or modify it | |
| 8 | +# under the terms of the GNU General Public License as published by | |
| 9 | +# the Free Software Foundation; either version 3 of the License, or | |
| 16 | 10 | # (at your option) any later version. |
| 17 | 11 | # |
| 18 | -# This program is distributed in the hope that it will be useful, | |
| 19 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 | -# GNU General Public License for more details. | |
| 12 | +# This program is distributed in the hope that it will be useful, but | |
| 13 | +# WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 15 | +# General Public License for more details. | |
| 22 | 16 | # |
| 23 | 17 | # You should have received a copy of the GNU General Public License |
| 24 | -# along with this program; if not, write to the Free Software | |
| 25 | -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA | |
| 26 | -# 02110-1301, USA. | |
| 18 | +# along with this program; if not, see <http://www.gnu.org/licenses/>. | |
| 27 | 19 | # |
| 28 | 20 | # As a special exception to the GNU General Public License, if you |
| 29 | 21 | # distribute this file as part of a program that contains a |
| 30 | 22 | # configuration script generated by Autoconf, you may include it under |
| 31 | -# the same distribution terms that you use for the rest of that program. | |
| 23 | +# the same distribution terms that you use for the rest of that | |
| 24 | +# program. This Exception is an additional permission under section 7 | |
| 25 | +# of the GNU General Public License, version 3 ("GPLv3"). | |
| 32 | 26 | |
| 33 | 27 | |
| 34 | -# Please send patches to <[email protected]>. Submit a context | |
| 35 | -# diff and a properly formatted GNU ChangeLog entry. | |
| 28 | +# Please send patches with a ChangeLog entry to [email protected]. | |
| 36 | 29 | # |
| 37 | 30 | # Configuration subroutine to validate and canonicalize a configuration type. |
| 38 | 31 | # Supply the specified configuration type as an argument. |
| 39 | 32 | # If it is invalid, we print an error message on stderr and exit with code 1. |
| 40 | 33 | # Otherwise, we print the canonical config type on stdout and succeed. |
| @@ -73,13 +66,11 @@ | ||
| 73 | 66 | Report bugs and patches to <[email protected]>." |
| 74 | 67 | |
| 75 | 68 | version="\ |
| 76 | 69 | GNU config.sub ($timestamp) |
| 77 | 70 | |
| 78 | -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | |
| 79 | -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free | |
| 80 | -Software Foundation, Inc. | |
| 71 | +Copyright 1992-2014 Free Software Foundation, Inc. | |
| 81 | 72 | |
| 82 | 73 | This is free software; see the source for copying conditions. There is NO |
| 83 | 74 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 84 | 75 | |
| 85 | 76 | help=" |
| @@ -123,17 +114,21 @@ | ||
| 123 | 114 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
| 124 | 115 | # Here we must recognize all the valid KERNEL-OS combinations. |
| 125 | 116 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
| 126 | 117 | case $maybe_os in |
| 127 | 118 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
| 128 | - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ | |
| 119 | + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ | |
| 129 | 120 | knetbsd*-gnu* | netbsd*-gnu* | \ |
| 130 | 121 | kopensolaris*-gnu* | \ |
| 131 | 122 | storm-chaos* | os2-emx* | rtmk-nova*) |
| 132 | 123 | os=-$maybe_os |
| 133 | 124 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
| 134 | 125 | ;; |
| 126 | + android-linux) | |
| 127 | + os=-linux-android | |
| 128 | + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown | |
| 129 | + ;; | |
| 135 | 130 | *) |
| 136 | 131 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` |
| 137 | 132 | if [ $basic_machine != $1 ] |
| 138 | 133 | then os=`echo $1 | sed 's/.*-/-/'` |
| 139 | 134 | else os=; fi |
| @@ -152,16 +147,16 @@ | ||
| 152 | 147 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ |
| 153 | 148 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ |
| 154 | 149 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ |
| 155 | 150 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ |
| 156 | 151 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ |
| 157 | - -apple | -axis | -knuth | -cray | -microblaze) | |
| 152 | + -apple | -axis | -knuth | -cray | -microblaze*) | |
| 158 | 153 | os= |
| 159 | 154 | basic_machine=$1 |
| 160 | 155 | ;; |
| 161 | - -bluegene*) | |
| 162 | - os=-cnk | |
| 156 | + -bluegene*) | |
| 157 | + os=-cnk | |
| 163 | 158 | ;; |
| 164 | 159 | -sim | -cisco | -oki | -wec | -winbond) |
| 165 | 160 | os= |
| 166 | 161 | basic_machine=$1 |
| 167 | 162 | ;; |
| @@ -173,14 +168,14 @@ | ||
| 173 | 168 | ;; |
| 174 | 169 | -chorusos*) |
| 175 | 170 | os=-chorusos |
| 176 | 171 | basic_machine=$1 |
| 177 | 172 | ;; |
| 178 | - -chorusrdb) | |
| 179 | - os=-chorusrdb | |
| 173 | + -chorusrdb) | |
| 174 | + os=-chorusrdb | |
| 180 | 175 | basic_machine=$1 |
| 181 | - ;; | |
| 176 | + ;; | |
| 182 | 177 | -hiux*) |
| 183 | 178 | os=-hiuxwe2 |
| 184 | 179 | ;; |
| 185 | 180 | -sco6) |
| 186 | 181 | os=-sco5v6 |
| @@ -221,10 +216,16 @@ | ||
| 221 | 216 | basic_machine=clipper-intergraph |
| 222 | 217 | ;; |
| 223 | 218 | -isc*) |
| 224 | 219 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
| 225 | 220 | ;; |
| 221 | + -lynx*178) | |
| 222 | + os=-lynxos178 | |
| 223 | + ;; | |
| 224 | + -lynx*5) | |
| 225 | + os=-lynxos5 | |
| 226 | + ;; | |
| 226 | 227 | -lynx*) |
| 227 | 228 | os=-lynxos |
| 228 | 229 | ;; |
| 229 | 230 | -ptx*) |
| 230 | 231 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` |
| @@ -245,24 +246,32 @@ | ||
| 245 | 246 | case $basic_machine in |
| 246 | 247 | # Recognize the basic CPU types without company name. |
| 247 | 248 | # Some are omitted here because they have special meanings below. |
| 248 | 249 | 1750a | 580 \ |
| 249 | 250 | | a29k \ |
| 251 | + | aarch64 | aarch64_be \ | |
| 250 | 252 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ |
| 251 | 253 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ |
| 252 | 254 | | am33_2.0 \ |
| 253 | - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | |
| 255 | + | arc | arceb \ | |
| 256 | + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | |
| 257 | + | avr | avr32 \ | |
| 258 | + | be32 | be64 \ | |
| 254 | 259 | | bfin \ |
| 255 | - | c4x | clipper \ | |
| 260 | + | c4x | c8051 | clipper \ | |
| 256 | 261 | | d10v | d30v | dlx | dsp16xx \ |
| 262 | + | epiphany \ | |
| 257 | 263 | | fido | fr30 | frv \ |
| 258 | 264 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
| 265 | + | hexagon \ | |
| 259 | 266 | | i370 | i860 | i960 | ia64 \ |
| 260 | 267 | | ip2k | iq2000 \ |
| 268 | + | k1om \ | |
| 269 | + | le32 | le64 \ | |
| 261 | 270 | | lm32 \ |
| 262 | 271 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ |
| 263 | - | maxq | mb | microblaze | mcore | mep | metag \ | |
| 272 | + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | |
| 264 | 273 | | mips | mipsbe | mipseb | mipsel | mipsle \ |
| 265 | 274 | | mips16 \ |
| 266 | 275 | | mips64 | mips64el \ |
| 267 | 276 | | mips64octeon | mips64octeonel \ |
| 268 | 277 | | mips64orion | mips64orionel \ |
| @@ -272,38 +281,41 @@ | ||
| 272 | 281 | | mips64vr4300 | mips64vr4300el \ |
| 273 | 282 | | mips64vr5000 | mips64vr5000el \ |
| 274 | 283 | | mips64vr5900 | mips64vr5900el \ |
| 275 | 284 | | mipsisa32 | mipsisa32el \ |
| 276 | 285 | | mipsisa32r2 | mipsisa32r2el \ |
| 286 | + | mipsisa32r6 | mipsisa32r6el \ | |
| 277 | 287 | | mipsisa64 | mipsisa64el \ |
| 278 | 288 | | mipsisa64r2 | mipsisa64r2el \ |
| 289 | + | mipsisa64r6 | mipsisa64r6el \ | |
| 279 | 290 | | mipsisa64sb1 | mipsisa64sb1el \ |
| 280 | 291 | | mipsisa64sr71k | mipsisa64sr71kel \ |
| 292 | + | mipsr5900 | mipsr5900el \ | |
| 281 | 293 | | mipstx39 | mipstx39el \ |
| 282 | 294 | | mn10200 | mn10300 \ |
| 283 | 295 | | moxie \ |
| 284 | 296 | | mt \ |
| 285 | 297 | | msp430 \ |
| 286 | 298 | | nds32 | nds32le | nds32be \ |
| 287 | - | nios | nios2 \ | |
| 299 | + | nios | nios2 | nios2eb | nios2el \ | |
| 288 | 300 | | ns16k | ns32k \ |
| 289 | - | or32 \ | |
| 301 | + | open8 | or1k | or1knd | or32 \ | |
| 290 | 302 | | pdp10 | pdp11 | pj | pjl \ |
| 291 | - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | |
| 303 | + | powerpc | powerpc64 | powerpc64le | powerpcle \ | |
| 292 | 304 | | pyramid \ |
| 293 | - | rx \ | |
| 305 | + | rl78 | rx \ | |
| 294 | 306 | | score \ |
| 295 | 307 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ |
| 296 | 308 | | sh64 | sh64le \ |
| 297 | 309 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ |
| 298 | 310 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ |
| 299 | - | spu | strongarm \ | |
| 300 | - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | |
| 311 | + | spu \ | |
| 312 | + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | |
| 301 | 313 | | ubicom32 \ |
| 302 | - | v850 | v850e \ | |
| 314 | + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | |
| 303 | 315 | | we32k \ |
| 304 | - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | |
| 316 | + | x86 | xc16x | xstormy16 | xtensa \ | |
| 305 | 317 | | z8k | z80) |
| 306 | 318 | basic_machine=$basic_machine-unknown |
| 307 | 319 | ;; |
| 308 | 320 | c54x) |
| 309 | 321 | basic_machine=tic54x-unknown |
| @@ -312,20 +324,34 @@ | ||
| 312 | 324 | basic_machine=tic55x-unknown |
| 313 | 325 | ;; |
| 314 | 326 | c6x) |
| 315 | 327 | basic_machine=tic6x-unknown |
| 316 | 328 | ;; |
| 317 | - m6811 | m68hc11 | m6812 | m68hc12 | picochip) | |
| 318 | - # Motorola 68HC11/12. | |
| 329 | + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) | |
| 319 | 330 | basic_machine=$basic_machine-unknown |
| 320 | 331 | os=-none |
| 321 | 332 | ;; |
| 322 | 333 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) |
| 323 | 334 | ;; |
| 324 | 335 | ms1) |
| 325 | 336 | basic_machine=mt-unknown |
| 326 | 337 | ;; |
| 338 | + | |
| 339 | + strongarm | thumb | xscale) | |
| 340 | + basic_machine=arm-unknown | |
| 341 | + ;; | |
| 342 | + xgate) | |
| 343 | + basic_machine=$basic_machine-unknown | |
| 344 | + os=-none | |
| 345 | + ;; | |
| 346 | + xscaleeb) | |
| 347 | + basic_machine=armeb-unknown | |
| 348 | + ;; | |
| 349 | + | |
| 350 | + xscaleel) | |
| 351 | + basic_machine=armel-unknown | |
| 352 | + ;; | |
| 327 | 353 | |
| 328 | 354 | # We use `pc' rather than `unknown' |
| 329 | 355 | # because (1) that's what they normally are, and |
| 330 | 356 | # (2) the word "unknown" tends to confuse beginning users. |
| 331 | 357 | i*86 | x86_64) |
| @@ -337,29 +363,35 @@ | ||
| 337 | 363 | exit 1 |
| 338 | 364 | ;; |
| 339 | 365 | # Recognize the basic CPU types with company name. |
| 340 | 366 | 580-* \ |
| 341 | 367 | | a29k-* \ |
| 368 | + | aarch64-* | aarch64_be-* \ | |
| 342 | 369 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ |
| 343 | 370 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ |
| 344 | - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | |
| 371 | + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | |
| 345 | 372 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ |
| 346 | 373 | | avr-* | avr32-* \ |
| 374 | + | be32-* | be64-* \ | |
| 347 | 375 | | bfin-* | bs2000-* \ |
| 348 | 376 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ |
| 349 | - | clipper-* | craynv-* | cydra-* \ | |
| 377 | + | c8051-* | clipper-* | craynv-* | cydra-* \ | |
| 350 | 378 | | d10v-* | d30v-* | dlx-* \ |
| 351 | 379 | | elxsi-* \ |
| 352 | 380 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ |
| 353 | 381 | | h8300-* | h8500-* \ |
| 354 | 382 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
| 383 | + | hexagon-* \ | |
| 355 | 384 | | i*86-* | i860-* | i960-* | ia64-* \ |
| 356 | 385 | | ip2k-* | iq2000-* \ |
| 386 | + | k1om-* \ | |
| 387 | + | le32-* | le64-* \ | |
| 357 | 388 | | lm32-* \ |
| 358 | 389 | | m32c-* | m32r-* | m32rle-* \ |
| 359 | 390 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ |
| 360 | - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | |
| 391 | + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | |
| 392 | + | microblaze-* | microblazeel-* \ | |
| 361 | 393 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ |
| 362 | 394 | | mips16-* \ |
| 363 | 395 | | mips64-* | mips64el-* \ |
| 364 | 396 | | mips64octeon-* | mips64octeonel-* \ |
| 365 | 397 | | mips64orion-* | mips64orionel-* \ |
| @@ -369,39 +401,45 @@ | ||
| 369 | 401 | | mips64vr4300-* | mips64vr4300el-* \ |
| 370 | 402 | | mips64vr5000-* | mips64vr5000el-* \ |
| 371 | 403 | | mips64vr5900-* | mips64vr5900el-* \ |
| 372 | 404 | | mipsisa32-* | mipsisa32el-* \ |
| 373 | 405 | | mipsisa32r2-* | mipsisa32r2el-* \ |
| 406 | + | mipsisa32r6-* | mipsisa32r6el-* \ | |
| 374 | 407 | | mipsisa64-* | mipsisa64el-* \ |
| 375 | 408 | | mipsisa64r2-* | mipsisa64r2el-* \ |
| 409 | + | mipsisa64r6-* | mipsisa64r6el-* \ | |
| 376 | 410 | | mipsisa64sb1-* | mipsisa64sb1el-* \ |
| 377 | 411 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ |
| 412 | + | mipsr5900-* | mipsr5900el-* \ | |
| 378 | 413 | | mipstx39-* | mipstx39el-* \ |
| 379 | 414 | | mmix-* \ |
| 380 | 415 | | mt-* \ |
| 381 | 416 | | msp430-* \ |
| 382 | 417 | | nds32-* | nds32le-* | nds32be-* \ |
| 383 | - | nios-* | nios2-* \ | |
| 418 | + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | |
| 384 | 419 | | none-* | np1-* | ns16k-* | ns32k-* \ |
| 420 | + | open8-* \ | |
| 421 | + | or1k*-* \ | |
| 385 | 422 | | orion-* \ |
| 386 | 423 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
| 387 | - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | |
| 424 | + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | |
| 388 | 425 | | pyramid-* \ |
| 389 | - | romp-* | rs6000-* | rx-* \ | |
| 426 | + | rl78-* | romp-* | rs6000-* | rx-* \ | |
| 390 | 427 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ |
| 391 | 428 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ |
| 392 | 429 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ |
| 393 | 430 | | sparclite-* \ |
| 394 | - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | |
| 395 | - | tahoe-* | thumb-* \ | |
| 431 | + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | |
| 432 | + | tahoe-* \ | |
| 396 | 433 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ |
| 397 | - | tile-* | tilegx-* \ | |
| 434 | + | tile*-* \ | |
| 398 | 435 | | tron-* \ |
| 399 | 436 | | ubicom32-* \ |
| 400 | - | v850-* | v850e-* | vax-* \ | |
| 437 | + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | |
| 438 | + | vax-* \ | |
| 401 | 439 | | we32k-* \ |
| 402 | - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | |
| 440 | + | x86-* | x86_64-* | xc16x-* | xps100-* \ | |
| 403 | 441 | | xstormy16-* | xtensa*-* \ |
| 404 | 442 | | ymp-* \ |
| 405 | 443 | | z8k-* | z80-*) |
| 406 | 444 | ;; |
| 407 | 445 | # Recognize the basic CPU types without company name, with glob match. |
| @@ -422,11 +460,11 @@ | ||
| 422 | 460 | ;; |
| 423 | 461 | a29khif) |
| 424 | 462 | basic_machine=a29k-amd |
| 425 | 463 | os=-udi |
| 426 | 464 | ;; |
| 427 | - abacus) | |
| 465 | + abacus) | |
| 428 | 466 | basic_machine=abacus-unknown |
| 429 | 467 | ;; |
| 430 | 468 | adobe68k) |
| 431 | 469 | basic_machine=m68010-adobe |
| 432 | 470 | os=-scout |
| @@ -505,11 +543,11 @@ | ||
| 505 | 543 | ;; |
| 506 | 544 | c90) |
| 507 | 545 | basic_machine=c90-cray |
| 508 | 546 | os=-unicos |
| 509 | 547 | ;; |
| 510 | - cegcc) | |
| 548 | + cegcc) | |
| 511 | 549 | basic_machine=arm-unknown |
| 512 | 550 | os=-cegcc |
| 513 | 551 | ;; |
| 514 | 552 | convex-c1) |
| 515 | 553 | basic_machine=c1-convex |
| @@ -537,11 +575,11 @@ | ||
| 537 | 575 | ;; |
| 538 | 576 | craynv) |
| 539 | 577 | basic_machine=craynv-cray |
| 540 | 578 | os=-unicosmp |
| 541 | 579 | ;; |
| 542 | - cr16) | |
| 580 | + cr16 | cr16-*) | |
| 543 | 581 | basic_machine=cr16-unknown |
| 544 | 582 | os=-elf |
| 545 | 583 | ;; |
| 546 | 584 | crds | unos) |
| 547 | 585 | basic_machine=m68k-crds |
| @@ -695,11 +733,10 @@ | ||
| 695 | 733 | os=-proelf |
| 696 | 734 | ;; |
| 697 | 735 | i370-ibm* | ibm*) |
| 698 | 736 | basic_machine=i370-ibm |
| 699 | 737 | ;; |
| 700 | -# I'm not sure what "Sysv32" means. Should this be sysv3.2? | |
| 701 | 738 | i*86v32) |
| 702 | 739 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` |
| 703 | 740 | os=-sysv32 |
| 704 | 741 | ;; |
| 705 | 742 | i*86v4*) |
| @@ -753,15 +790,19 @@ | ||
| 753 | 790 | ;; |
| 754 | 791 | merlin) |
| 755 | 792 | basic_machine=ns32k-utek |
| 756 | 793 | os=-sysv |
| 757 | 794 | ;; |
| 758 | - microblaze) | |
| 795 | + microblaze*) | |
| 759 | 796 | basic_machine=microblaze-xilinx |
| 760 | 797 | ;; |
| 798 | + mingw64) | |
| 799 | + basic_machine=x86_64-pc | |
| 800 | + os=-mingw64 | |
| 801 | + ;; | |
| 761 | 802 | mingw32) |
| 762 | - basic_machine=i386-pc | |
| 803 | + basic_machine=i686-pc | |
| 763 | 804 | os=-mingw32 |
| 764 | 805 | ;; |
| 765 | 806 | mingw32ce) |
| 766 | 807 | basic_machine=arm-unknown |
| 767 | 808 | os=-mingw32ce |
| @@ -792,18 +833,22 @@ | ||
| 792 | 833 | os=-msdos |
| 793 | 834 | ;; |
| 794 | 835 | ms1-*) |
| 795 | 836 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` |
| 796 | 837 | ;; |
| 838 | + msys) | |
| 839 | + basic_machine=i686-pc | |
| 840 | + os=-msys | |
| 841 | + ;; | |
| 797 | 842 | mvs) |
| 798 | 843 | basic_machine=i370-ibm |
| 799 | 844 | os=-mvs |
| 800 | 845 | ;; |
| 801 | - msys) | |
| 802 | - basic_machine=i386-pc | |
| 803 | - os=-msys | |
| 804 | - ;; | |
| 846 | + nacl) | |
| 847 | + basic_machine=le32-unknown | |
| 848 | + os=-nacl | |
| 849 | + ;; | |
| 805 | 850 | ncr3000) |
| 806 | 851 | basic_machine=i486-ncr |
| 807 | 852 | os=-sysv4 |
| 808 | 853 | ;; |
| 809 | 854 | netbsd386) |
| @@ -864,14 +909,14 @@ | ||
| 864 | 909 | os=-nonstopux |
| 865 | 910 | ;; |
| 866 | 911 | np1) |
| 867 | 912 | basic_machine=np1-gould |
| 868 | 913 | ;; |
| 869 | - neo-tandem) | |
| 914 | + neo-tandem) | |
| 870 | 915 | basic_machine=neo-tandem |
| 871 | 916 | ;; |
| 872 | - nse-tandem) | |
| 917 | + nse-tandem) | |
| 873 | 918 | basic_machine=nse-tandem |
| 874 | 919 | ;; |
| 875 | 920 | nsr-tandem) |
| 876 | 921 | basic_machine=nsr-tandem |
| 877 | 922 | ;; |
| @@ -952,13 +997,14 @@ | ||
| 952 | 997 | pn) |
| 953 | 998 | basic_machine=pn-gould |
| 954 | 999 | ;; |
| 955 | 1000 | power) basic_machine=power-ibm |
| 956 | 1001 | ;; |
| 957 | - ppc) basic_machine=powerpc-unknown | |
| 1002 | + ppc | ppcbe) basic_machine=powerpc-unknown | |
| 958 | 1003 | ;; |
| 959 | - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 1004 | + ppc-* | ppcbe-*) | |
| 1005 | + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 960 | 1006 | ;; |
| 961 | 1007 | ppcle | powerpclittle | ppc-le | powerpc-little) |
| 962 | 1008 | basic_machine=powerpcle-unknown |
| 963 | 1009 | ;; |
| 964 | 1010 | ppcle-* | powerpclittle-*) |
| @@ -979,11 +1025,15 @@ | ||
| 979 | 1025 | ;; |
| 980 | 1026 | pw32) |
| 981 | 1027 | basic_machine=i586-unknown |
| 982 | 1028 | os=-pw32 |
| 983 | 1029 | ;; |
| 984 | - rdos) | |
| 1030 | + rdos | rdos64) | |
| 1031 | + basic_machine=x86_64-pc | |
| 1032 | + os=-rdos | |
| 1033 | + ;; | |
| 1034 | + rdos32) | |
| 985 | 1035 | basic_machine=i386-pc |
| 986 | 1036 | os=-rdos |
| 987 | 1037 | ;; |
| 988 | 1038 | rom68k) |
| 989 | 1039 | basic_machine=m68k-rom68k |
| @@ -1048,10 +1098,13 @@ | ||
| 1048 | 1098 | ;; |
| 1049 | 1099 | stratus) |
| 1050 | 1100 | basic_machine=i860-stratus |
| 1051 | 1101 | os=-sysv4 |
| 1052 | 1102 | ;; |
| 1103 | + strongarm-* | thumb-*) | |
| 1104 | + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 1105 | + ;; | |
| 1053 | 1106 | sun2) |
| 1054 | 1107 | basic_machine=m68000-sun |
| 1055 | 1108 | ;; |
| 1056 | 1109 | sun2os3) |
| 1057 | 1110 | basic_machine=m68000-sun |
| @@ -1104,17 +1157,12 @@ | ||
| 1104 | 1157 | ;; |
| 1105 | 1158 | t90) |
| 1106 | 1159 | basic_machine=t90-cray |
| 1107 | 1160 | os=-unicos |
| 1108 | 1161 | ;; |
| 1109 | - # This must be matched before tile*. | |
| 1110 | - tilegx*) | |
| 1111 | - basic_machine=tilegx-unknown | |
| 1112 | - os=-linux-gnu | |
| 1113 | - ;; | |
| 1114 | 1162 | tile*) |
| 1115 | - basic_machine=tile-unknown | |
| 1163 | + basic_machine=$basic_machine-unknown | |
| 1116 | 1164 | os=-linux-gnu |
| 1117 | 1165 | ;; |
| 1118 | 1166 | tx39) |
| 1119 | 1167 | basic_machine=mipstx39-unknown |
| 1120 | 1168 | ;; |
| @@ -1180,10 +1228,13 @@ | ||
| 1180 | 1228 | os=-mingw32 |
| 1181 | 1229 | ;; |
| 1182 | 1230 | xps | xps100) |
| 1183 | 1231 | basic_machine=xps100-honeywell |
| 1184 | 1232 | ;; |
| 1233 | + xscale-* | xscalee[bl]-*) | |
| 1234 | + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` | |
| 1235 | + ;; | |
| 1185 | 1236 | ymp) |
| 1186 | 1237 | basic_machine=ymp-cray |
| 1187 | 1238 | os=-unicos |
| 1188 | 1239 | ;; |
| 1189 | 1240 | z8k-*-coff) |
| @@ -1277,15 +1328,15 @@ | ||
| 1277 | 1328 | # Decode manufacturer-specific aliases for certain operating systems. |
| 1278 | 1329 | |
| 1279 | 1330 | if [ x"$os" != x"" ] |
| 1280 | 1331 | then |
| 1281 | 1332 | case $os in |
| 1282 | - # First match some system type aliases | |
| 1283 | - # that might get confused with valid system types. | |
| 1333 | + # First match some system type aliases | |
| 1334 | + # that might get confused with valid system types. | |
| 1284 | 1335 | # -solaris* is a basic system type, with this one exception. |
| 1285 | - -auroraux) | |
| 1286 | - os=-auroraux | |
| 1336 | + -auroraux) | |
| 1337 | + os=-auroraux | |
| 1287 | 1338 | ;; |
| 1288 | 1339 | -solaris1 | -solaris1.*) |
| 1289 | 1340 | os=`echo $os | sed -e 's|solaris1|sunos4|'` |
| 1290 | 1341 | ;; |
| 1291 | 1342 | -solaris) |
| @@ -1305,33 +1356,33 @@ | ||
| 1305 | 1356 | # Each alternative MUST END IN A *, to match a version number. |
| 1306 | 1357 | # -sysv* is not here because it comes later, after sysvr4. |
| 1307 | 1358 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
| 1308 | 1359 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
| 1309 | 1360 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ |
| 1310 | - | -sym* | -kopensolaris* \ | |
| 1361 | + | -sym* | -kopensolaris* | -plan9* \ | |
| 1311 | 1362 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
| 1312 | 1363 | | -aos* | -aros* \ |
| 1313 | 1364 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
| 1314 | 1365 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
| 1315 | 1366 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
| 1316 | - | -openbsd* | -solidbsd* \ | |
| 1367 | + | -bitrig* | -openbsd* | -solidbsd* \ | |
| 1317 | 1368 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
| 1318 | 1369 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
| 1319 | 1370 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
| 1320 | 1371 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
| 1321 | 1372 | | -chorusos* | -chorusrdb* | -cegcc* \ |
| 1322 | 1373 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
| 1323 | - | -mingw32* | -linux-gnu* | -linux-android* \ | |
| 1324 | - | -linux-newlib* | -linux-uclibc* \ | |
| 1374 | + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | |
| 1375 | + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | |
| 1325 | 1376 | | -uxpv* | -beos* | -mpeix* | -udk* \ |
| 1326 | 1377 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
| 1327 | 1378 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
| 1328 | 1379 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
| 1329 | 1380 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
| 1330 | 1381 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| 1331 | 1382 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| 1332 | - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | |
| 1383 | + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) | |
| 1333 | 1384 | # Remember, each alternative MUST END IN *, to match a version number. |
| 1334 | 1385 | ;; |
| 1335 | 1386 | -qnx*) |
| 1336 | 1387 | case $basic_machine in |
| 1337 | 1388 | x86-* | i*86-*) |
| @@ -1366,11 +1417,11 @@ | ||
| 1366 | 1417 | os=`echo $os | sed -e 's|sunos6|solaris3|'` |
| 1367 | 1418 | ;; |
| 1368 | 1419 | -opened*) |
| 1369 | 1420 | os=-openedition |
| 1370 | 1421 | ;; |
| 1371 | - -os400*) | |
| 1422 | + -os400*) | |
| 1372 | 1423 | os=-os400 |
| 1373 | 1424 | ;; |
| 1374 | 1425 | -wince*) |
| 1375 | 1426 | os=-wince |
| 1376 | 1427 | ;; |
| @@ -1415,11 +1466,11 @@ | ||
| 1415 | 1466 | os=`echo $os | sed -e 's|sinix|sysv|'` |
| 1416 | 1467 | ;; |
| 1417 | 1468 | -sinix*) |
| 1418 | 1469 | os=-sysv4 |
| 1419 | 1470 | ;; |
| 1420 | - -tpf*) | |
| 1471 | + -tpf*) | |
| 1421 | 1472 | os=-tpf |
| 1422 | 1473 | ;; |
| 1423 | 1474 | -triton*) |
| 1424 | 1475 | os=-sysv3 |
| 1425 | 1476 | ;; |
| @@ -1451,21 +1502,18 @@ | ||
| 1451 | 1502 | os=-mint |
| 1452 | 1503 | ;; |
| 1453 | 1504 | -aros*) |
| 1454 | 1505 | os=-aros |
| 1455 | 1506 | ;; |
| 1456 | - -kaos*) | |
| 1457 | - os=-kaos | |
| 1458 | - ;; | |
| 1459 | 1507 | -zvmoe) |
| 1460 | 1508 | os=-zvmoe |
| 1461 | 1509 | ;; |
| 1462 | 1510 | -dicos*) |
| 1463 | 1511 | os=-dicos |
| 1464 | 1512 | ;; |
| 1465 | - -nacl*) | |
| 1466 | - ;; | |
| 1513 | + -nacl*) | |
| 1514 | + ;; | |
| 1467 | 1515 | -none) |
| 1468 | 1516 | ;; |
| 1469 | 1517 | *) |
| 1470 | 1518 | # Get rid of the `-' at the beginning of $os. |
| 1471 | 1519 | os=`echo $os | sed 's/[^-]*-//'` |
| @@ -1484,14 +1532,14 @@ | ||
| 1484 | 1532 | # that MANUFACTURER isn't an operating system. Otherwise, code above |
| 1485 | 1533 | # will signal an error saying that MANUFACTURER isn't an operating |
| 1486 | 1534 | # system, and we'll never get to this point. |
| 1487 | 1535 | |
| 1488 | 1536 | case $basic_machine in |
| 1489 | - score-*) | |
| 1537 | + score-*) | |
| 1490 | 1538 | os=-elf |
| 1491 | 1539 | ;; |
| 1492 | - spu-*) | |
| 1540 | + spu-*) | |
| 1493 | 1541 | os=-elf |
| 1494 | 1542 | ;; |
| 1495 | 1543 | *-acorn) |
| 1496 | 1544 | os=-riscix1.2 |
| 1497 | 1545 | ;; |
| @@ -1499,12 +1547,18 @@ | ||
| 1499 | 1547 | os=-linux |
| 1500 | 1548 | ;; |
| 1501 | 1549 | arm*-semi) |
| 1502 | 1550 | os=-aout |
| 1503 | 1551 | ;; |
| 1504 | - c4x-* | tic4x-*) | |
| 1505 | - os=-coff | |
| 1552 | + c4x-* | tic4x-*) | |
| 1553 | + os=-coff | |
| 1554 | + ;; | |
| 1555 | + c8051-*) | |
| 1556 | + os=-elf | |
| 1557 | + ;; | |
| 1558 | + hexagon-*) | |
| 1559 | + os=-elf | |
| 1506 | 1560 | ;; |
| 1507 | 1561 | tic54x-*) |
| 1508 | 1562 | os=-coff |
| 1509 | 1563 | ;; |
| 1510 | 1564 | tic55x-*) |
| @@ -1529,18 +1583,15 @@ | ||
| 1529 | 1583 | i386-sun) |
| 1530 | 1584 | os=-sunos4.0.2 |
| 1531 | 1585 | ;; |
| 1532 | 1586 | m68000-sun) |
| 1533 | 1587 | os=-sunos3 |
| 1534 | - # This also exists in the configure program, but was not the | |
| 1535 | - # default. | |
| 1536 | - # os=-sunos4 | |
| 1537 | 1588 | ;; |
| 1538 | 1589 | m68*-cisco) |
| 1539 | 1590 | os=-aout |
| 1540 | 1591 | ;; |
| 1541 | - mep-*) | |
| 1592 | + mep-*) | |
| 1542 | 1593 | os=-elf |
| 1543 | 1594 | ;; |
| 1544 | 1595 | mips*-cisco) |
| 1545 | 1596 | os=-elf |
| 1546 | 1597 | ;; |
| @@ -1563,11 +1614,11 @@ | ||
| 1563 | 1614 | os=-haiku |
| 1564 | 1615 | ;; |
| 1565 | 1616 | *-ibm) |
| 1566 | 1617 | os=-aix |
| 1567 | 1618 | ;; |
| 1568 | - *-knuth) | |
| 1619 | + *-knuth) | |
| 1569 | 1620 | os=-mmixware |
| 1570 | 1621 | ;; |
| 1571 | 1622 | *-wec) |
| 1572 | 1623 | os=-proelf |
| 1573 | 1624 | ;; |
| 1574 | 1625 |
| --- autosetup/config.sub | |
| +++ autosetup/config.sub | |
| @@ -1,40 +1,33 @@ | |
| 1 | #! /bin/sh |
| 2 | # Configuration validation subroutine script. |
| 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 5 | # Free Software Foundation, Inc. |
| 6 | |
| 7 | timestamp='2010-09-11' |
| 8 | |
| 9 | # This file is (in principle) common to ALL GNU software. |
| 10 | # The presence of a machine in this file suggests that SOME GNU software |
| 11 | # can handle that machine. It does not imply ALL GNU software can. |
| 12 | # |
| 13 | # This file is free software; you can redistribute it and/or modify |
| 14 | # it under the terms of the GNU General Public License as published by |
| 15 | # the Free Software Foundation; either version 2 of the License, or |
| 16 | # (at your option) any later version. |
| 17 | # |
| 18 | # This program is distributed in the hope that it will be useful, |
| 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | # GNU General Public License for more details. |
| 22 | # |
| 23 | # You should have received a copy of the GNU General Public License |
| 24 | # along with this program; if not, write to the Free Software |
| 25 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
| 26 | # 02110-1301, USA. |
| 27 | # |
| 28 | # As a special exception to the GNU General Public License, if you |
| 29 | # distribute this file as part of a program that contains a |
| 30 | # configuration script generated by Autoconf, you may include it under |
| 31 | # the same distribution terms that you use for the rest of that program. |
| 32 | |
| 33 | |
| 34 | # Please send patches to <[email protected]>. Submit a context |
| 35 | # diff and a properly formatted GNU ChangeLog entry. |
| 36 | # |
| 37 | # Configuration subroutine to validate and canonicalize a configuration type. |
| 38 | # Supply the specified configuration type as an argument. |
| 39 | # If it is invalid, we print an error message on stderr and exit with code 1. |
| 40 | # Otherwise, we print the canonical config type on stdout and succeed. |
| @@ -73,13 +66,11 @@ | |
| 73 | Report bugs and patches to <[email protected]>." |
| 74 | |
| 75 | version="\ |
| 76 | GNU config.sub ($timestamp) |
| 77 | |
| 78 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
| 79 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free |
| 80 | Software Foundation, Inc. |
| 81 | |
| 82 | This is free software; see the source for copying conditions. There is NO |
| 83 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 84 | |
| 85 | help=" |
| @@ -123,17 +114,21 @@ | |
| 123 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
| 124 | # Here we must recognize all the valid KERNEL-OS combinations. |
| 125 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
| 126 | case $maybe_os in |
| 127 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
| 128 | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ |
| 129 | knetbsd*-gnu* | netbsd*-gnu* | \ |
| 130 | kopensolaris*-gnu* | \ |
| 131 | storm-chaos* | os2-emx* | rtmk-nova*) |
| 132 | os=-$maybe_os |
| 133 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
| 134 | ;; |
| 135 | *) |
| 136 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` |
| 137 | if [ $basic_machine != $1 ] |
| 138 | then os=`echo $1 | sed 's/.*-/-/'` |
| 139 | else os=; fi |
| @@ -152,16 +147,16 @@ | |
| 152 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ |
| 153 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ |
| 154 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ |
| 155 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ |
| 156 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ |
| 157 | -apple | -axis | -knuth | -cray | -microblaze) |
| 158 | os= |
| 159 | basic_machine=$1 |
| 160 | ;; |
| 161 | -bluegene*) |
| 162 | os=-cnk |
| 163 | ;; |
| 164 | -sim | -cisco | -oki | -wec | -winbond) |
| 165 | os= |
| 166 | basic_machine=$1 |
| 167 | ;; |
| @@ -173,14 +168,14 @@ | |
| 173 | ;; |
| 174 | -chorusos*) |
| 175 | os=-chorusos |
| 176 | basic_machine=$1 |
| 177 | ;; |
| 178 | -chorusrdb) |
| 179 | os=-chorusrdb |
| 180 | basic_machine=$1 |
| 181 | ;; |
| 182 | -hiux*) |
| 183 | os=-hiuxwe2 |
| 184 | ;; |
| 185 | -sco6) |
| 186 | os=-sco5v6 |
| @@ -221,10 +216,16 @@ | |
| 221 | basic_machine=clipper-intergraph |
| 222 | ;; |
| 223 | -isc*) |
| 224 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
| 225 | ;; |
| 226 | -lynx*) |
| 227 | os=-lynxos |
| 228 | ;; |
| 229 | -ptx*) |
| 230 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` |
| @@ -245,24 +246,32 @@ | |
| 245 | case $basic_machine in |
| 246 | # Recognize the basic CPU types without company name. |
| 247 | # Some are omitted here because they have special meanings below. |
| 248 | 1750a | 580 \ |
| 249 | | a29k \ |
| 250 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ |
| 251 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ |
| 252 | | am33_2.0 \ |
| 253 | | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ |
| 254 | | bfin \ |
| 255 | | c4x | clipper \ |
| 256 | | d10v | d30v | dlx | dsp16xx \ |
| 257 | | fido | fr30 | frv \ |
| 258 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
| 259 | | i370 | i860 | i960 | ia64 \ |
| 260 | | ip2k | iq2000 \ |
| 261 | | lm32 \ |
| 262 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ |
| 263 | | maxq | mb | microblaze | mcore | mep | metag \ |
| 264 | | mips | mipsbe | mipseb | mipsel | mipsle \ |
| 265 | | mips16 \ |
| 266 | | mips64 | mips64el \ |
| 267 | | mips64octeon | mips64octeonel \ |
| 268 | | mips64orion | mips64orionel \ |
| @@ -272,38 +281,41 @@ | |
| 272 | | mips64vr4300 | mips64vr4300el \ |
| 273 | | mips64vr5000 | mips64vr5000el \ |
| 274 | | mips64vr5900 | mips64vr5900el \ |
| 275 | | mipsisa32 | mipsisa32el \ |
| 276 | | mipsisa32r2 | mipsisa32r2el \ |
| 277 | | mipsisa64 | mipsisa64el \ |
| 278 | | mipsisa64r2 | mipsisa64r2el \ |
| 279 | | mipsisa64sb1 | mipsisa64sb1el \ |
| 280 | | mipsisa64sr71k | mipsisa64sr71kel \ |
| 281 | | mipstx39 | mipstx39el \ |
| 282 | | mn10200 | mn10300 \ |
| 283 | | moxie \ |
| 284 | | mt \ |
| 285 | | msp430 \ |
| 286 | | nds32 | nds32le | nds32be \ |
| 287 | | nios | nios2 \ |
| 288 | | ns16k | ns32k \ |
| 289 | | or32 \ |
| 290 | | pdp10 | pdp11 | pj | pjl \ |
| 291 | | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ |
| 292 | | pyramid \ |
| 293 | | rx \ |
| 294 | | score \ |
| 295 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ |
| 296 | | sh64 | sh64le \ |
| 297 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ |
| 298 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ |
| 299 | | spu | strongarm \ |
| 300 | | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ |
| 301 | | ubicom32 \ |
| 302 | | v850 | v850e \ |
| 303 | | we32k \ |
| 304 | | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ |
| 305 | | z8k | z80) |
| 306 | basic_machine=$basic_machine-unknown |
| 307 | ;; |
| 308 | c54x) |
| 309 | basic_machine=tic54x-unknown |
| @@ -312,20 +324,34 @@ | |
| 312 | basic_machine=tic55x-unknown |
| 313 | ;; |
| 314 | c6x) |
| 315 | basic_machine=tic6x-unknown |
| 316 | ;; |
| 317 | m6811 | m68hc11 | m6812 | m68hc12 | picochip) |
| 318 | # Motorola 68HC11/12. |
| 319 | basic_machine=$basic_machine-unknown |
| 320 | os=-none |
| 321 | ;; |
| 322 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) |
| 323 | ;; |
| 324 | ms1) |
| 325 | basic_machine=mt-unknown |
| 326 | ;; |
| 327 | |
| 328 | # We use `pc' rather than `unknown' |
| 329 | # because (1) that's what they normally are, and |
| 330 | # (2) the word "unknown" tends to confuse beginning users. |
| 331 | i*86 | x86_64) |
| @@ -337,29 +363,35 @@ | |
| 337 | exit 1 |
| 338 | ;; |
| 339 | # Recognize the basic CPU types with company name. |
| 340 | 580-* \ |
| 341 | | a29k-* \ |
| 342 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ |
| 343 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ |
| 344 | | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ |
| 345 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ |
| 346 | | avr-* | avr32-* \ |
| 347 | | bfin-* | bs2000-* \ |
| 348 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ |
| 349 | | clipper-* | craynv-* | cydra-* \ |
| 350 | | d10v-* | d30v-* | dlx-* \ |
| 351 | | elxsi-* \ |
| 352 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ |
| 353 | | h8300-* | h8500-* \ |
| 354 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
| 355 | | i*86-* | i860-* | i960-* | ia64-* \ |
| 356 | | ip2k-* | iq2000-* \ |
| 357 | | lm32-* \ |
| 358 | | m32c-* | m32r-* | m32rle-* \ |
| 359 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ |
| 360 | | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ |
| 361 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ |
| 362 | | mips16-* \ |
| 363 | | mips64-* | mips64el-* \ |
| 364 | | mips64octeon-* | mips64octeonel-* \ |
| 365 | | mips64orion-* | mips64orionel-* \ |
| @@ -369,39 +401,45 @@ | |
| 369 | | mips64vr4300-* | mips64vr4300el-* \ |
| 370 | | mips64vr5000-* | mips64vr5000el-* \ |
| 371 | | mips64vr5900-* | mips64vr5900el-* \ |
| 372 | | mipsisa32-* | mipsisa32el-* \ |
| 373 | | mipsisa32r2-* | mipsisa32r2el-* \ |
| 374 | | mipsisa64-* | mipsisa64el-* \ |
| 375 | | mipsisa64r2-* | mipsisa64r2el-* \ |
| 376 | | mipsisa64sb1-* | mipsisa64sb1el-* \ |
| 377 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ |
| 378 | | mipstx39-* | mipstx39el-* \ |
| 379 | | mmix-* \ |
| 380 | | mt-* \ |
| 381 | | msp430-* \ |
| 382 | | nds32-* | nds32le-* | nds32be-* \ |
| 383 | | nios-* | nios2-* \ |
| 384 | | none-* | np1-* | ns16k-* | ns32k-* \ |
| 385 | | orion-* \ |
| 386 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
| 387 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ |
| 388 | | pyramid-* \ |
| 389 | | romp-* | rs6000-* | rx-* \ |
| 390 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ |
| 391 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ |
| 392 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ |
| 393 | | sparclite-* \ |
| 394 | | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ |
| 395 | | tahoe-* | thumb-* \ |
| 396 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ |
| 397 | | tile-* | tilegx-* \ |
| 398 | | tron-* \ |
| 399 | | ubicom32-* \ |
| 400 | | v850-* | v850e-* | vax-* \ |
| 401 | | we32k-* \ |
| 402 | | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ |
| 403 | | xstormy16-* | xtensa*-* \ |
| 404 | | ymp-* \ |
| 405 | | z8k-* | z80-*) |
| 406 | ;; |
| 407 | # Recognize the basic CPU types without company name, with glob match. |
| @@ -422,11 +460,11 @@ | |
| 422 | ;; |
| 423 | a29khif) |
| 424 | basic_machine=a29k-amd |
| 425 | os=-udi |
| 426 | ;; |
| 427 | abacus) |
| 428 | basic_machine=abacus-unknown |
| 429 | ;; |
| 430 | adobe68k) |
| 431 | basic_machine=m68010-adobe |
| 432 | os=-scout |
| @@ -505,11 +543,11 @@ | |
| 505 | ;; |
| 506 | c90) |
| 507 | basic_machine=c90-cray |
| 508 | os=-unicos |
| 509 | ;; |
| 510 | cegcc) |
| 511 | basic_machine=arm-unknown |
| 512 | os=-cegcc |
| 513 | ;; |
| 514 | convex-c1) |
| 515 | basic_machine=c1-convex |
| @@ -537,11 +575,11 @@ | |
| 537 | ;; |
| 538 | craynv) |
| 539 | basic_machine=craynv-cray |
| 540 | os=-unicosmp |
| 541 | ;; |
| 542 | cr16) |
| 543 | basic_machine=cr16-unknown |
| 544 | os=-elf |
| 545 | ;; |
| 546 | crds | unos) |
| 547 | basic_machine=m68k-crds |
| @@ -695,11 +733,10 @@ | |
| 695 | os=-proelf |
| 696 | ;; |
| 697 | i370-ibm* | ibm*) |
| 698 | basic_machine=i370-ibm |
| 699 | ;; |
| 700 | # I'm not sure what "Sysv32" means. Should this be sysv3.2? |
| 701 | i*86v32) |
| 702 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` |
| 703 | os=-sysv32 |
| 704 | ;; |
| 705 | i*86v4*) |
| @@ -753,15 +790,19 @@ | |
| 753 | ;; |
| 754 | merlin) |
| 755 | basic_machine=ns32k-utek |
| 756 | os=-sysv |
| 757 | ;; |
| 758 | microblaze) |
| 759 | basic_machine=microblaze-xilinx |
| 760 | ;; |
| 761 | mingw32) |
| 762 | basic_machine=i386-pc |
| 763 | os=-mingw32 |
| 764 | ;; |
| 765 | mingw32ce) |
| 766 | basic_machine=arm-unknown |
| 767 | os=-mingw32ce |
| @@ -792,18 +833,22 @@ | |
| 792 | os=-msdos |
| 793 | ;; |
| 794 | ms1-*) |
| 795 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` |
| 796 | ;; |
| 797 | mvs) |
| 798 | basic_machine=i370-ibm |
| 799 | os=-mvs |
| 800 | ;; |
| 801 | msys) |
| 802 | basic_machine=i386-pc |
| 803 | os=-msys |
| 804 | ;; |
| 805 | ncr3000) |
| 806 | basic_machine=i486-ncr |
| 807 | os=-sysv4 |
| 808 | ;; |
| 809 | netbsd386) |
| @@ -864,14 +909,14 @@ | |
| 864 | os=-nonstopux |
| 865 | ;; |
| 866 | np1) |
| 867 | basic_machine=np1-gould |
| 868 | ;; |
| 869 | neo-tandem) |
| 870 | basic_machine=neo-tandem |
| 871 | ;; |
| 872 | nse-tandem) |
| 873 | basic_machine=nse-tandem |
| 874 | ;; |
| 875 | nsr-tandem) |
| 876 | basic_machine=nsr-tandem |
| 877 | ;; |
| @@ -952,13 +997,14 @@ | |
| 952 | pn) |
| 953 | basic_machine=pn-gould |
| 954 | ;; |
| 955 | power) basic_machine=power-ibm |
| 956 | ;; |
| 957 | ppc) basic_machine=powerpc-unknown |
| 958 | ;; |
| 959 | ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` |
| 960 | ;; |
| 961 | ppcle | powerpclittle | ppc-le | powerpc-little) |
| 962 | basic_machine=powerpcle-unknown |
| 963 | ;; |
| 964 | ppcle-* | powerpclittle-*) |
| @@ -979,11 +1025,15 @@ | |
| 979 | ;; |
| 980 | pw32) |
| 981 | basic_machine=i586-unknown |
| 982 | os=-pw32 |
| 983 | ;; |
| 984 | rdos) |
| 985 | basic_machine=i386-pc |
| 986 | os=-rdos |
| 987 | ;; |
| 988 | rom68k) |
| 989 | basic_machine=m68k-rom68k |
| @@ -1048,10 +1098,13 @@ | |
| 1048 | ;; |
| 1049 | stratus) |
| 1050 | basic_machine=i860-stratus |
| 1051 | os=-sysv4 |
| 1052 | ;; |
| 1053 | sun2) |
| 1054 | basic_machine=m68000-sun |
| 1055 | ;; |
| 1056 | sun2os3) |
| 1057 | basic_machine=m68000-sun |
| @@ -1104,17 +1157,12 @@ | |
| 1104 | ;; |
| 1105 | t90) |
| 1106 | basic_machine=t90-cray |
| 1107 | os=-unicos |
| 1108 | ;; |
| 1109 | # This must be matched before tile*. |
| 1110 | tilegx*) |
| 1111 | basic_machine=tilegx-unknown |
| 1112 | os=-linux-gnu |
| 1113 | ;; |
| 1114 | tile*) |
| 1115 | basic_machine=tile-unknown |
| 1116 | os=-linux-gnu |
| 1117 | ;; |
| 1118 | tx39) |
| 1119 | basic_machine=mipstx39-unknown |
| 1120 | ;; |
| @@ -1180,10 +1228,13 @@ | |
| 1180 | os=-mingw32 |
| 1181 | ;; |
| 1182 | xps | xps100) |
| 1183 | basic_machine=xps100-honeywell |
| 1184 | ;; |
| 1185 | ymp) |
| 1186 | basic_machine=ymp-cray |
| 1187 | os=-unicos |
| 1188 | ;; |
| 1189 | z8k-*-coff) |
| @@ -1277,15 +1328,15 @@ | |
| 1277 | # Decode manufacturer-specific aliases for certain operating systems. |
| 1278 | |
| 1279 | if [ x"$os" != x"" ] |
| 1280 | then |
| 1281 | case $os in |
| 1282 | # First match some system type aliases |
| 1283 | # that might get confused with valid system types. |
| 1284 | # -solaris* is a basic system type, with this one exception. |
| 1285 | -auroraux) |
| 1286 | os=-auroraux |
| 1287 | ;; |
| 1288 | -solaris1 | -solaris1.*) |
| 1289 | os=`echo $os | sed -e 's|solaris1|sunos4|'` |
| 1290 | ;; |
| 1291 | -solaris) |
| @@ -1305,33 +1356,33 @@ | |
| 1305 | # Each alternative MUST END IN A *, to match a version number. |
| 1306 | # -sysv* is not here because it comes later, after sysvr4. |
| 1307 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
| 1308 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
| 1309 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ |
| 1310 | | -sym* | -kopensolaris* \ |
| 1311 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
| 1312 | | -aos* | -aros* \ |
| 1313 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
| 1314 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
| 1315 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
| 1316 | | -openbsd* | -solidbsd* \ |
| 1317 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
| 1318 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
| 1319 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
| 1320 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
| 1321 | | -chorusos* | -chorusrdb* | -cegcc* \ |
| 1322 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
| 1323 | | -mingw32* | -linux-gnu* | -linux-android* \ |
| 1324 | | -linux-newlib* | -linux-uclibc* \ |
| 1325 | | -uxpv* | -beos* | -mpeix* | -udk* \ |
| 1326 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
| 1327 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
| 1328 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
| 1329 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
| 1330 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| 1331 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| 1332 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) |
| 1333 | # Remember, each alternative MUST END IN *, to match a version number. |
| 1334 | ;; |
| 1335 | -qnx*) |
| 1336 | case $basic_machine in |
| 1337 | x86-* | i*86-*) |
| @@ -1366,11 +1417,11 @@ | |
| 1366 | os=`echo $os | sed -e 's|sunos6|solaris3|'` |
| 1367 | ;; |
| 1368 | -opened*) |
| 1369 | os=-openedition |
| 1370 | ;; |
| 1371 | -os400*) |
| 1372 | os=-os400 |
| 1373 | ;; |
| 1374 | -wince*) |
| 1375 | os=-wince |
| 1376 | ;; |
| @@ -1415,11 +1466,11 @@ | |
| 1415 | os=`echo $os | sed -e 's|sinix|sysv|'` |
| 1416 | ;; |
| 1417 | -sinix*) |
| 1418 | os=-sysv4 |
| 1419 | ;; |
| 1420 | -tpf*) |
| 1421 | os=-tpf |
| 1422 | ;; |
| 1423 | -triton*) |
| 1424 | os=-sysv3 |
| 1425 | ;; |
| @@ -1451,21 +1502,18 @@ | |
| 1451 | os=-mint |
| 1452 | ;; |
| 1453 | -aros*) |
| 1454 | os=-aros |
| 1455 | ;; |
| 1456 | -kaos*) |
| 1457 | os=-kaos |
| 1458 | ;; |
| 1459 | -zvmoe) |
| 1460 | os=-zvmoe |
| 1461 | ;; |
| 1462 | -dicos*) |
| 1463 | os=-dicos |
| 1464 | ;; |
| 1465 | -nacl*) |
| 1466 | ;; |
| 1467 | -none) |
| 1468 | ;; |
| 1469 | *) |
| 1470 | # Get rid of the `-' at the beginning of $os. |
| 1471 | os=`echo $os | sed 's/[^-]*-//'` |
| @@ -1484,14 +1532,14 @@ | |
| 1484 | # that MANUFACTURER isn't an operating system. Otherwise, code above |
| 1485 | # will signal an error saying that MANUFACTURER isn't an operating |
| 1486 | # system, and we'll never get to this point. |
| 1487 | |
| 1488 | case $basic_machine in |
| 1489 | score-*) |
| 1490 | os=-elf |
| 1491 | ;; |
| 1492 | spu-*) |
| 1493 | os=-elf |
| 1494 | ;; |
| 1495 | *-acorn) |
| 1496 | os=-riscix1.2 |
| 1497 | ;; |
| @@ -1499,12 +1547,18 @@ | |
| 1499 | os=-linux |
| 1500 | ;; |
| 1501 | arm*-semi) |
| 1502 | os=-aout |
| 1503 | ;; |
| 1504 | c4x-* | tic4x-*) |
| 1505 | os=-coff |
| 1506 | ;; |
| 1507 | tic54x-*) |
| 1508 | os=-coff |
| 1509 | ;; |
| 1510 | tic55x-*) |
| @@ -1529,18 +1583,15 @@ | |
| 1529 | i386-sun) |
| 1530 | os=-sunos4.0.2 |
| 1531 | ;; |
| 1532 | m68000-sun) |
| 1533 | os=-sunos3 |
| 1534 | # This also exists in the configure program, but was not the |
| 1535 | # default. |
| 1536 | # os=-sunos4 |
| 1537 | ;; |
| 1538 | m68*-cisco) |
| 1539 | os=-aout |
| 1540 | ;; |
| 1541 | mep-*) |
| 1542 | os=-elf |
| 1543 | ;; |
| 1544 | mips*-cisco) |
| 1545 | os=-elf |
| 1546 | ;; |
| @@ -1563,11 +1614,11 @@ | |
| 1563 | os=-haiku |
| 1564 | ;; |
| 1565 | *-ibm) |
| 1566 | os=-aix |
| 1567 | ;; |
| 1568 | *-knuth) |
| 1569 | os=-mmixware |
| 1570 | ;; |
| 1571 | *-wec) |
| 1572 | os=-proelf |
| 1573 | ;; |
| 1574 |
| --- autosetup/config.sub | |
| +++ autosetup/config.sub | |
| @@ -1,40 +1,33 @@ | |
| 1 | #! /bin/sh |
| 2 | # Configuration validation subroutine script. |
| 3 | # Copyright 1992-2014 Free Software Foundation, Inc. |
| 4 | |
| 5 | timestamp='2014-05-01' |
| 6 | |
| 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, but |
| 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | # General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 19 | # |
| 20 | # As a special exception to the GNU General Public License, if you |
| 21 | # distribute this file as part of a program that contains a |
| 22 | # configuration script generated by Autoconf, you may include it under |
| 23 | # the same distribution terms that you use for the rest of that |
| 24 | # program. This Exception is an additional permission under section 7 |
| 25 | # of the GNU General Public License, version 3 ("GPLv3"). |
| 26 | |
| 27 | |
| 28 | # Please send patches with a ChangeLog entry to [email protected]. |
| 29 | # |
| 30 | # Configuration subroutine to validate and canonicalize a configuration type. |
| 31 | # Supply the specified configuration type as an argument. |
| 32 | # If it is invalid, we print an error message on stderr and exit with code 1. |
| 33 | # Otherwise, we print the canonical config type on stdout and succeed. |
| @@ -73,13 +66,11 @@ | |
| 66 | Report bugs and patches to <[email protected]>." |
| 67 | |
| 68 | version="\ |
| 69 | GNU config.sub ($timestamp) |
| 70 | |
| 71 | Copyright 1992-2014 Free Software Foundation, Inc. |
| 72 | |
| 73 | This is free software; see the source for copying conditions. There is NO |
| 74 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 75 | |
| 76 | help=" |
| @@ -123,17 +114,21 @@ | |
| 114 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
| 115 | # Here we must recognize all the valid KERNEL-OS combinations. |
| 116 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
| 117 | case $maybe_os in |
| 118 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
| 119 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ |
| 120 | knetbsd*-gnu* | netbsd*-gnu* | \ |
| 121 | kopensolaris*-gnu* | \ |
| 122 | storm-chaos* | os2-emx* | rtmk-nova*) |
| 123 | os=-$maybe_os |
| 124 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
| 125 | ;; |
| 126 | android-linux) |
| 127 | os=-linux-android |
| 128 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown |
| 129 | ;; |
| 130 | *) |
| 131 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` |
| 132 | if [ $basic_machine != $1 ] |
| 133 | then os=`echo $1 | sed 's/.*-/-/'` |
| 134 | else os=; fi |
| @@ -152,16 +147,16 @@ | |
| 147 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ |
| 148 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ |
| 149 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ |
| 150 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ |
| 151 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ |
| 152 | -apple | -axis | -knuth | -cray | -microblaze*) |
| 153 | os= |
| 154 | basic_machine=$1 |
| 155 | ;; |
| 156 | -bluegene*) |
| 157 | os=-cnk |
| 158 | ;; |
| 159 | -sim | -cisco | -oki | -wec | -winbond) |
| 160 | os= |
| 161 | basic_machine=$1 |
| 162 | ;; |
| @@ -173,14 +168,14 @@ | |
| 168 | ;; |
| 169 | -chorusos*) |
| 170 | os=-chorusos |
| 171 | basic_machine=$1 |
| 172 | ;; |
| 173 | -chorusrdb) |
| 174 | os=-chorusrdb |
| 175 | basic_machine=$1 |
| 176 | ;; |
| 177 | -hiux*) |
| 178 | os=-hiuxwe2 |
| 179 | ;; |
| 180 | -sco6) |
| 181 | os=-sco5v6 |
| @@ -221,10 +216,16 @@ | |
| 216 | basic_machine=clipper-intergraph |
| 217 | ;; |
| 218 | -isc*) |
| 219 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
| 220 | ;; |
| 221 | -lynx*178) |
| 222 | os=-lynxos178 |
| 223 | ;; |
| 224 | -lynx*5) |
| 225 | os=-lynxos5 |
| 226 | ;; |
| 227 | -lynx*) |
| 228 | os=-lynxos |
| 229 | ;; |
| 230 | -ptx*) |
| 231 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` |
| @@ -245,24 +246,32 @@ | |
| 246 | case $basic_machine in |
| 247 | # Recognize the basic CPU types without company name. |
| 248 | # Some are omitted here because they have special meanings below. |
| 249 | 1750a | 580 \ |
| 250 | | a29k \ |
| 251 | | aarch64 | aarch64_be \ |
| 252 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ |
| 253 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ |
| 254 | | am33_2.0 \ |
| 255 | | arc | arceb \ |
| 256 | | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ |
| 257 | | avr | avr32 \ |
| 258 | | be32 | be64 \ |
| 259 | | bfin \ |
| 260 | | c4x | c8051 | clipper \ |
| 261 | | d10v | d30v | dlx | dsp16xx \ |
| 262 | | epiphany \ |
| 263 | | fido | fr30 | frv \ |
| 264 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
| 265 | | hexagon \ |
| 266 | | i370 | i860 | i960 | ia64 \ |
| 267 | | ip2k | iq2000 \ |
| 268 | | k1om \ |
| 269 | | le32 | le64 \ |
| 270 | | lm32 \ |
| 271 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ |
| 272 | | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ |
| 273 | | mips | mipsbe | mipseb | mipsel | mipsle \ |
| 274 | | mips16 \ |
| 275 | | mips64 | mips64el \ |
| 276 | | mips64octeon | mips64octeonel \ |
| 277 | | mips64orion | mips64orionel \ |
| @@ -272,38 +281,41 @@ | |
| 281 | | mips64vr4300 | mips64vr4300el \ |
| 282 | | mips64vr5000 | mips64vr5000el \ |
| 283 | | mips64vr5900 | mips64vr5900el \ |
| 284 | | mipsisa32 | mipsisa32el \ |
| 285 | | mipsisa32r2 | mipsisa32r2el \ |
| 286 | | mipsisa32r6 | mipsisa32r6el \ |
| 287 | | mipsisa64 | mipsisa64el \ |
| 288 | | mipsisa64r2 | mipsisa64r2el \ |
| 289 | | mipsisa64r6 | mipsisa64r6el \ |
| 290 | | mipsisa64sb1 | mipsisa64sb1el \ |
| 291 | | mipsisa64sr71k | mipsisa64sr71kel \ |
| 292 | | mipsr5900 | mipsr5900el \ |
| 293 | | mipstx39 | mipstx39el \ |
| 294 | | mn10200 | mn10300 \ |
| 295 | | moxie \ |
| 296 | | mt \ |
| 297 | | msp430 \ |
| 298 | | nds32 | nds32le | nds32be \ |
| 299 | | nios | nios2 | nios2eb | nios2el \ |
| 300 | | ns16k | ns32k \ |
| 301 | | open8 | or1k | or1knd | or32 \ |
| 302 | | pdp10 | pdp11 | pj | pjl \ |
| 303 | | powerpc | powerpc64 | powerpc64le | powerpcle \ |
| 304 | | pyramid \ |
| 305 | | rl78 | rx \ |
| 306 | | score \ |
| 307 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ |
| 308 | | sh64 | sh64le \ |
| 309 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ |
| 310 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ |
| 311 | | spu \ |
| 312 | | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ |
| 313 | | ubicom32 \ |
| 314 | | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ |
| 315 | | we32k \ |
| 316 | | x86 | xc16x | xstormy16 | xtensa \ |
| 317 | | z8k | z80) |
| 318 | basic_machine=$basic_machine-unknown |
| 319 | ;; |
| 320 | c54x) |
| 321 | basic_machine=tic54x-unknown |
| @@ -312,20 +324,34 @@ | |
| 324 | basic_machine=tic55x-unknown |
| 325 | ;; |
| 326 | c6x) |
| 327 | basic_machine=tic6x-unknown |
| 328 | ;; |
| 329 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) |
| 330 | basic_machine=$basic_machine-unknown |
| 331 | os=-none |
| 332 | ;; |
| 333 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) |
| 334 | ;; |
| 335 | ms1) |
| 336 | basic_machine=mt-unknown |
| 337 | ;; |
| 338 | |
| 339 | strongarm | thumb | xscale) |
| 340 | basic_machine=arm-unknown |
| 341 | ;; |
| 342 | xgate) |
| 343 | basic_machine=$basic_machine-unknown |
| 344 | os=-none |
| 345 | ;; |
| 346 | xscaleeb) |
| 347 | basic_machine=armeb-unknown |
| 348 | ;; |
| 349 | |
| 350 | xscaleel) |
| 351 | basic_machine=armel-unknown |
| 352 | ;; |
| 353 | |
| 354 | # We use `pc' rather than `unknown' |
| 355 | # because (1) that's what they normally are, and |
| 356 | # (2) the word "unknown" tends to confuse beginning users. |
| 357 | i*86 | x86_64) |
| @@ -337,29 +363,35 @@ | |
| 363 | exit 1 |
| 364 | ;; |
| 365 | # Recognize the basic CPU types with company name. |
| 366 | 580-* \ |
| 367 | | a29k-* \ |
| 368 | | aarch64-* | aarch64_be-* \ |
| 369 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ |
| 370 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ |
| 371 | | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ |
| 372 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ |
| 373 | | avr-* | avr32-* \ |
| 374 | | be32-* | be64-* \ |
| 375 | | bfin-* | bs2000-* \ |
| 376 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ |
| 377 | | c8051-* | clipper-* | craynv-* | cydra-* \ |
| 378 | | d10v-* | d30v-* | dlx-* \ |
| 379 | | elxsi-* \ |
| 380 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ |
| 381 | | h8300-* | h8500-* \ |
| 382 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
| 383 | | hexagon-* \ |
| 384 | | i*86-* | i860-* | i960-* | ia64-* \ |
| 385 | | ip2k-* | iq2000-* \ |
| 386 | | k1om-* \ |
| 387 | | le32-* | le64-* \ |
| 388 | | lm32-* \ |
| 389 | | m32c-* | m32r-* | m32rle-* \ |
| 390 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ |
| 391 | | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ |
| 392 | | microblaze-* | microblazeel-* \ |
| 393 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ |
| 394 | | mips16-* \ |
| 395 | | mips64-* | mips64el-* \ |
| 396 | | mips64octeon-* | mips64octeonel-* \ |
| 397 | | mips64orion-* | mips64orionel-* \ |
| @@ -369,39 +401,45 @@ | |
| 401 | | mips64vr4300-* | mips64vr4300el-* \ |
| 402 | | mips64vr5000-* | mips64vr5000el-* \ |
| 403 | | mips64vr5900-* | mips64vr5900el-* \ |
| 404 | | mipsisa32-* | mipsisa32el-* \ |
| 405 | | mipsisa32r2-* | mipsisa32r2el-* \ |
| 406 | | mipsisa32r6-* | mipsisa32r6el-* \ |
| 407 | | mipsisa64-* | mipsisa64el-* \ |
| 408 | | mipsisa64r2-* | mipsisa64r2el-* \ |
| 409 | | mipsisa64r6-* | mipsisa64r6el-* \ |
| 410 | | mipsisa64sb1-* | mipsisa64sb1el-* \ |
| 411 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ |
| 412 | | mipsr5900-* | mipsr5900el-* \ |
| 413 | | mipstx39-* | mipstx39el-* \ |
| 414 | | mmix-* \ |
| 415 | | mt-* \ |
| 416 | | msp430-* \ |
| 417 | | nds32-* | nds32le-* | nds32be-* \ |
| 418 | | nios-* | nios2-* | nios2eb-* | nios2el-* \ |
| 419 | | none-* | np1-* | ns16k-* | ns32k-* \ |
| 420 | | open8-* \ |
| 421 | | or1k*-* \ |
| 422 | | orion-* \ |
| 423 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
| 424 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ |
| 425 | | pyramid-* \ |
| 426 | | rl78-* | romp-* | rs6000-* | rx-* \ |
| 427 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ |
| 428 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ |
| 429 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ |
| 430 | | sparclite-* \ |
| 431 | | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ |
| 432 | | tahoe-* \ |
| 433 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ |
| 434 | | tile*-* \ |
| 435 | | tron-* \ |
| 436 | | ubicom32-* \ |
| 437 | | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ |
| 438 | | vax-* \ |
| 439 | | we32k-* \ |
| 440 | | x86-* | x86_64-* | xc16x-* | xps100-* \ |
| 441 | | xstormy16-* | xtensa*-* \ |
| 442 | | ymp-* \ |
| 443 | | z8k-* | z80-*) |
| 444 | ;; |
| 445 | # Recognize the basic CPU types without company name, with glob match. |
| @@ -422,11 +460,11 @@ | |
| 460 | ;; |
| 461 | a29khif) |
| 462 | basic_machine=a29k-amd |
| 463 | os=-udi |
| 464 | ;; |
| 465 | abacus) |
| 466 | basic_machine=abacus-unknown |
| 467 | ;; |
| 468 | adobe68k) |
| 469 | basic_machine=m68010-adobe |
| 470 | os=-scout |
| @@ -505,11 +543,11 @@ | |
| 543 | ;; |
| 544 | c90) |
| 545 | basic_machine=c90-cray |
| 546 | os=-unicos |
| 547 | ;; |
| 548 | cegcc) |
| 549 | basic_machine=arm-unknown |
| 550 | os=-cegcc |
| 551 | ;; |
| 552 | convex-c1) |
| 553 | basic_machine=c1-convex |
| @@ -537,11 +575,11 @@ | |
| 575 | ;; |
| 576 | craynv) |
| 577 | basic_machine=craynv-cray |
| 578 | os=-unicosmp |
| 579 | ;; |
| 580 | cr16 | cr16-*) |
| 581 | basic_machine=cr16-unknown |
| 582 | os=-elf |
| 583 | ;; |
| 584 | crds | unos) |
| 585 | basic_machine=m68k-crds |
| @@ -695,11 +733,10 @@ | |
| 733 | os=-proelf |
| 734 | ;; |
| 735 | i370-ibm* | ibm*) |
| 736 | basic_machine=i370-ibm |
| 737 | ;; |
| 738 | i*86v32) |
| 739 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` |
| 740 | os=-sysv32 |
| 741 | ;; |
| 742 | i*86v4*) |
| @@ -753,15 +790,19 @@ | |
| 790 | ;; |
| 791 | merlin) |
| 792 | basic_machine=ns32k-utek |
| 793 | os=-sysv |
| 794 | ;; |
| 795 | microblaze*) |
| 796 | basic_machine=microblaze-xilinx |
| 797 | ;; |
| 798 | mingw64) |
| 799 | basic_machine=x86_64-pc |
| 800 | os=-mingw64 |
| 801 | ;; |
| 802 | mingw32) |
| 803 | basic_machine=i686-pc |
| 804 | os=-mingw32 |
| 805 | ;; |
| 806 | mingw32ce) |
| 807 | basic_machine=arm-unknown |
| 808 | os=-mingw32ce |
| @@ -792,18 +833,22 @@ | |
| 833 | os=-msdos |
| 834 | ;; |
| 835 | ms1-*) |
| 836 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` |
| 837 | ;; |
| 838 | msys) |
| 839 | basic_machine=i686-pc |
| 840 | os=-msys |
| 841 | ;; |
| 842 | mvs) |
| 843 | basic_machine=i370-ibm |
| 844 | os=-mvs |
| 845 | ;; |
| 846 | nacl) |
| 847 | basic_machine=le32-unknown |
| 848 | os=-nacl |
| 849 | ;; |
| 850 | ncr3000) |
| 851 | basic_machine=i486-ncr |
| 852 | os=-sysv4 |
| 853 | ;; |
| 854 | netbsd386) |
| @@ -864,14 +909,14 @@ | |
| 909 | os=-nonstopux |
| 910 | ;; |
| 911 | np1) |
| 912 | basic_machine=np1-gould |
| 913 | ;; |
| 914 | neo-tandem) |
| 915 | basic_machine=neo-tandem |
| 916 | ;; |
| 917 | nse-tandem) |
| 918 | basic_machine=nse-tandem |
| 919 | ;; |
| 920 | nsr-tandem) |
| 921 | basic_machine=nsr-tandem |
| 922 | ;; |
| @@ -952,13 +997,14 @@ | |
| 997 | pn) |
| 998 | basic_machine=pn-gould |
| 999 | ;; |
| 1000 | power) basic_machine=power-ibm |
| 1001 | ;; |
| 1002 | ppc | ppcbe) basic_machine=powerpc-unknown |
| 1003 | ;; |
| 1004 | ppc-* | ppcbe-*) |
| 1005 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` |
| 1006 | ;; |
| 1007 | ppcle | powerpclittle | ppc-le | powerpc-little) |
| 1008 | basic_machine=powerpcle-unknown |
| 1009 | ;; |
| 1010 | ppcle-* | powerpclittle-*) |
| @@ -979,11 +1025,15 @@ | |
| 1025 | ;; |
| 1026 | pw32) |
| 1027 | basic_machine=i586-unknown |
| 1028 | os=-pw32 |
| 1029 | ;; |
| 1030 | rdos | rdos64) |
| 1031 | basic_machine=x86_64-pc |
| 1032 | os=-rdos |
| 1033 | ;; |
| 1034 | rdos32) |
| 1035 | basic_machine=i386-pc |
| 1036 | os=-rdos |
| 1037 | ;; |
| 1038 | rom68k) |
| 1039 | basic_machine=m68k-rom68k |
| @@ -1048,10 +1098,13 @@ | |
| 1098 | ;; |
| 1099 | stratus) |
| 1100 | basic_machine=i860-stratus |
| 1101 | os=-sysv4 |
| 1102 | ;; |
| 1103 | strongarm-* | thumb-*) |
| 1104 | basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` |
| 1105 | ;; |
| 1106 | sun2) |
| 1107 | basic_machine=m68000-sun |
| 1108 | ;; |
| 1109 | sun2os3) |
| 1110 | basic_machine=m68000-sun |
| @@ -1104,17 +1157,12 @@ | |
| 1157 | ;; |
| 1158 | t90) |
| 1159 | basic_machine=t90-cray |
| 1160 | os=-unicos |
| 1161 | ;; |
| 1162 | tile*) |
| 1163 | basic_machine=$basic_machine-unknown |
| 1164 | os=-linux-gnu |
| 1165 | ;; |
| 1166 | tx39) |
| 1167 | basic_machine=mipstx39-unknown |
| 1168 | ;; |
| @@ -1180,10 +1228,13 @@ | |
| 1228 | os=-mingw32 |
| 1229 | ;; |
| 1230 | xps | xps100) |
| 1231 | basic_machine=xps100-honeywell |
| 1232 | ;; |
| 1233 | xscale-* | xscalee[bl]-*) |
| 1234 | basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` |
| 1235 | ;; |
| 1236 | ymp) |
| 1237 | basic_machine=ymp-cray |
| 1238 | os=-unicos |
| 1239 | ;; |
| 1240 | z8k-*-coff) |
| @@ -1277,15 +1328,15 @@ | |
| 1328 | # Decode manufacturer-specific aliases for certain operating systems. |
| 1329 | |
| 1330 | if [ x"$os" != x"" ] |
| 1331 | then |
| 1332 | case $os in |
| 1333 | # First match some system type aliases |
| 1334 | # that might get confused with valid system types. |
| 1335 | # -solaris* is a basic system type, with this one exception. |
| 1336 | -auroraux) |
| 1337 | os=-auroraux |
| 1338 | ;; |
| 1339 | -solaris1 | -solaris1.*) |
| 1340 | os=`echo $os | sed -e 's|solaris1|sunos4|'` |
| 1341 | ;; |
| 1342 | -solaris) |
| @@ -1305,33 +1356,33 @@ | |
| 1356 | # Each alternative MUST END IN A *, to match a version number. |
| 1357 | # -sysv* is not here because it comes later, after sysvr4. |
| 1358 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
| 1359 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
| 1360 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ |
| 1361 | | -sym* | -kopensolaris* | -plan9* \ |
| 1362 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
| 1363 | | -aos* | -aros* \ |
| 1364 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
| 1365 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
| 1366 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
| 1367 | | -bitrig* | -openbsd* | -solidbsd* \ |
| 1368 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
| 1369 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
| 1370 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
| 1371 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
| 1372 | | -chorusos* | -chorusrdb* | -cegcc* \ |
| 1373 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
| 1374 | | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ |
| 1375 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ |
| 1376 | | -uxpv* | -beos* | -mpeix* | -udk* \ |
| 1377 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
| 1378 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
| 1379 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
| 1380 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
| 1381 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| 1382 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| 1383 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) |
| 1384 | # Remember, each alternative MUST END IN *, to match a version number. |
| 1385 | ;; |
| 1386 | -qnx*) |
| 1387 | case $basic_machine in |
| 1388 | x86-* | i*86-*) |
| @@ -1366,11 +1417,11 @@ | |
| 1417 | os=`echo $os | sed -e 's|sunos6|solaris3|'` |
| 1418 | ;; |
| 1419 | -opened*) |
| 1420 | os=-openedition |
| 1421 | ;; |
| 1422 | -os400*) |
| 1423 | os=-os400 |
| 1424 | ;; |
| 1425 | -wince*) |
| 1426 | os=-wince |
| 1427 | ;; |
| @@ -1415,11 +1466,11 @@ | |
| 1466 | os=`echo $os | sed -e 's|sinix|sysv|'` |
| 1467 | ;; |
| 1468 | -sinix*) |
| 1469 | os=-sysv4 |
| 1470 | ;; |
| 1471 | -tpf*) |
| 1472 | os=-tpf |
| 1473 | ;; |
| 1474 | -triton*) |
| 1475 | os=-sysv3 |
| 1476 | ;; |
| @@ -1451,21 +1502,18 @@ | |
| 1502 | os=-mint |
| 1503 | ;; |
| 1504 | -aros*) |
| 1505 | os=-aros |
| 1506 | ;; |
| 1507 | -zvmoe) |
| 1508 | os=-zvmoe |
| 1509 | ;; |
| 1510 | -dicos*) |
| 1511 | os=-dicos |
| 1512 | ;; |
| 1513 | -nacl*) |
| 1514 | ;; |
| 1515 | -none) |
| 1516 | ;; |
| 1517 | *) |
| 1518 | # Get rid of the `-' at the beginning of $os. |
| 1519 | os=`echo $os | sed 's/[^-]*-//'` |
| @@ -1484,14 +1532,14 @@ | |
| 1532 | # that MANUFACTURER isn't an operating system. Otherwise, code above |
| 1533 | # will signal an error saying that MANUFACTURER isn't an operating |
| 1534 | # system, and we'll never get to this point. |
| 1535 | |
| 1536 | case $basic_machine in |
| 1537 | score-*) |
| 1538 | os=-elf |
| 1539 | ;; |
| 1540 | spu-*) |
| 1541 | os=-elf |
| 1542 | ;; |
| 1543 | *-acorn) |
| 1544 | os=-riscix1.2 |
| 1545 | ;; |
| @@ -1499,12 +1547,18 @@ | |
| 1547 | os=-linux |
| 1548 | ;; |
| 1549 | arm*-semi) |
| 1550 | os=-aout |
| 1551 | ;; |
| 1552 | c4x-* | tic4x-*) |
| 1553 | os=-coff |
| 1554 | ;; |
| 1555 | c8051-*) |
| 1556 | os=-elf |
| 1557 | ;; |
| 1558 | hexagon-*) |
| 1559 | os=-elf |
| 1560 | ;; |
| 1561 | tic54x-*) |
| 1562 | os=-coff |
| 1563 | ;; |
| 1564 | tic55x-*) |
| @@ -1529,18 +1583,15 @@ | |
| 1583 | i386-sun) |
| 1584 | os=-sunos4.0.2 |
| 1585 | ;; |
| 1586 | m68000-sun) |
| 1587 | os=-sunos3 |
| 1588 | ;; |
| 1589 | m68*-cisco) |
| 1590 | os=-aout |
| 1591 | ;; |
| 1592 | mep-*) |
| 1593 | os=-elf |
| 1594 | ;; |
| 1595 | mips*-cisco) |
| 1596 | os=-elf |
| 1597 | ;; |
| @@ -1563,11 +1614,11 @@ | |
| 1614 | os=-haiku |
| 1615 | ;; |
| 1616 | *-ibm) |
| 1617 | os=-aix |
| 1618 | ;; |
| 1619 | *-knuth) |
| 1620 | os=-mmixware |
| 1621 | ;; |
| 1622 | *-wec) |
| 1623 | os=-proelf |
| 1624 | ;; |
| 1625 |
+19
-2
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -107,10 +107,12 @@ | ||
| 107 | 107 | ** |
| 108 | 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | 109 | ** subsequent clean, extras, list, pull, push, rebuild, and |
| 110 | 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | 111 | ** local checkouts to be ignored instead. |
| 112 | +** | |
| 113 | +** info Run the "info" command on all repositories. | |
| 112 | 114 | ** |
| 113 | 115 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 114 | 116 | ** option causes all local checkouts to be listed instead. |
| 115 | 117 | ** |
| 116 | 118 | ** pull Run a "pull" operation on all repositories. Only the |
| @@ -155,10 +157,11 @@ | ||
| 155 | 157 | int dryRunFlag = 0; |
| 156 | 158 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | 159 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | 160 | int rc; |
| 159 | 161 | int nToDel = 0; |
| 162 | + int showLabel = 0; | |
| 160 | 163 | |
| 161 | 164 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 162 | 165 | if( !dryRunFlag ){ |
| 163 | 166 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | 167 | } |
| @@ -258,32 +261,40 @@ | ||
| 258 | 261 | } |
| 259 | 262 | fossil_free(zSql); |
| 260 | 263 | } |
| 261 | 264 | db_end_transaction(0); |
| 262 | 265 | return; |
| 266 | + }else if( strncmp(zCmd, "info", n)==0 ){ | |
| 267 | + zCmd = "info"; | |
| 268 | + showLabel = 1; | |
| 269 | + quiet = 1; | |
| 263 | 270 | }else{ |
| 264 | 271 | fossil_fatal("\"all\" subcommand should be one of: " |
| 265 | 272 | "changes clean extras ignore list ls push pull rebuild sync"); |
| 266 | 273 | } |
| 267 | 274 | verify_all_options(); |
| 268 | 275 | zFossil = quoteFilename(g.nameOfExe); |
| 276 | + db_multi_exec("CREATE TEMP TABLE repolist(name,tag);"); | |
| 269 | 277 | if( useCheckouts ){ |
| 270 | - db_prepare(&q, | |
| 278 | + db_multi_exec( | |
| 279 | + "INSERT INTO repolist " | |
| 271 | 280 | "SELECT DISTINCT substr(name, 7), name COLLATE nocase" |
| 272 | 281 | " FROM global_config" |
| 273 | 282 | " WHERE substr(name, 1, 6)=='ckout:'" |
| 274 | 283 | " ORDER BY 1" |
| 275 | 284 | ); |
| 276 | 285 | }else{ |
| 277 | - db_prepare(&q, | |
| 286 | + db_multi_exec( | |
| 287 | + "INSERT INTO repolist " | |
| 278 | 288 | "SELECT DISTINCT substr(name, 6), name COLLATE nocase" |
| 279 | 289 | " FROM global_config" |
| 280 | 290 | " WHERE substr(name, 1, 5)=='repo:'" |
| 281 | 291 | " ORDER BY 1" |
| 282 | 292 | ); |
| 283 | 293 | } |
| 284 | 294 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 295 | + db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1"); | |
| 285 | 296 | while( db_step(&q)==SQLITE_ROW ){ |
| 286 | 297 | const char *zFilename = db_column_text(&q, 0); |
| 287 | 298 | if( file_access(zFilename, F_OK) |
| 288 | 299 | || !file_is_canonical(zFilename) |
| 289 | 300 | || (useCheckouts && file_isdir(zFilename)!=1) |
| @@ -300,10 +311,16 @@ | ||
| 300 | 311 | zFilename); |
| 301 | 312 | } |
| 302 | 313 | zQFilename = quoteFilename(zFilename); |
| 303 | 314 | zSyscmd = mprintf("%s %s %s%s", |
| 304 | 315 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 316 | + if( showLabel ){ | |
| 317 | + int len = (int)strlen(zFilename); | |
| 318 | + int nStar = 80 - (len + 15); | |
| 319 | + if( nStar<2 ) nStar = 1; | |
| 320 | + fossil_print("%.13c %s %.*c\n", '*', zFilename, nStar, '*'); | |
| 321 | + } | |
| 305 | 322 | if( !quiet || dryRunFlag ){ |
| 306 | 323 | fossil_print("%s\n", zSyscmd); |
| 307 | 324 | fflush(stdout); |
| 308 | 325 | } |
| 309 | 326 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 310 | 327 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -107,10 +107,12 @@ | |
| 107 | ** |
| 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | ** subsequent clean, extras, list, pull, push, rebuild, and |
| 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | ** local checkouts to be ignored instead. |
| 112 | ** |
| 113 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 114 | ** option causes all local checkouts to be listed instead. |
| 115 | ** |
| 116 | ** pull Run a "pull" operation on all repositories. Only the |
| @@ -155,10 +157,11 @@ | |
| 155 | int dryRunFlag = 0; |
| 156 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | int rc; |
| 159 | int nToDel = 0; |
| 160 | |
| 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 162 | if( !dryRunFlag ){ |
| 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | } |
| @@ -258,32 +261,40 @@ | |
| 258 | } |
| 259 | fossil_free(zSql); |
| 260 | } |
| 261 | db_end_transaction(0); |
| 262 | return; |
| 263 | }else{ |
| 264 | fossil_fatal("\"all\" subcommand should be one of: " |
| 265 | "changes clean extras ignore list ls push pull rebuild sync"); |
| 266 | } |
| 267 | verify_all_options(); |
| 268 | zFossil = quoteFilename(g.nameOfExe); |
| 269 | if( useCheckouts ){ |
| 270 | db_prepare(&q, |
| 271 | "SELECT DISTINCT substr(name, 7), name COLLATE nocase" |
| 272 | " FROM global_config" |
| 273 | " WHERE substr(name, 1, 6)=='ckout:'" |
| 274 | " ORDER BY 1" |
| 275 | ); |
| 276 | }else{ |
| 277 | db_prepare(&q, |
| 278 | "SELECT DISTINCT substr(name, 6), name COLLATE nocase" |
| 279 | " FROM global_config" |
| 280 | " WHERE substr(name, 1, 5)=='repo:'" |
| 281 | " ORDER BY 1" |
| 282 | ); |
| 283 | } |
| 284 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 285 | while( db_step(&q)==SQLITE_ROW ){ |
| 286 | const char *zFilename = db_column_text(&q, 0); |
| 287 | if( file_access(zFilename, F_OK) |
| 288 | || !file_is_canonical(zFilename) |
| 289 | || (useCheckouts && file_isdir(zFilename)!=1) |
| @@ -300,10 +311,16 @@ | |
| 300 | zFilename); |
| 301 | } |
| 302 | zQFilename = quoteFilename(zFilename); |
| 303 | zSyscmd = mprintf("%s %s %s%s", |
| 304 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 305 | if( !quiet || dryRunFlag ){ |
| 306 | fossil_print("%s\n", zSyscmd); |
| 307 | fflush(stdout); |
| 308 | } |
| 309 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 310 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -107,10 +107,12 @@ | |
| 107 | ** |
| 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | ** subsequent clean, extras, list, pull, push, rebuild, and |
| 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | ** local checkouts to be ignored instead. |
| 112 | ** |
| 113 | ** info Run the "info" command on all repositories. |
| 114 | ** |
| 115 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 116 | ** option causes all local checkouts to be listed instead. |
| 117 | ** |
| 118 | ** pull Run a "pull" operation on all repositories. Only the |
| @@ -155,10 +157,11 @@ | |
| 157 | int dryRunFlag = 0; |
| 158 | int showFile = find_option("showfile",0,0)!=0; |
| 159 | int stopOnError = find_option("dontstop",0,0)==0; |
| 160 | int rc; |
| 161 | int nToDel = 0; |
| 162 | int showLabel = 0; |
| 163 | |
| 164 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 165 | if( !dryRunFlag ){ |
| 166 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 167 | } |
| @@ -258,32 +261,40 @@ | |
| 261 | } |
| 262 | fossil_free(zSql); |
| 263 | } |
| 264 | db_end_transaction(0); |
| 265 | return; |
| 266 | }else if( strncmp(zCmd, "info", n)==0 ){ |
| 267 | zCmd = "info"; |
| 268 | showLabel = 1; |
| 269 | quiet = 1; |
| 270 | }else{ |
| 271 | fossil_fatal("\"all\" subcommand should be one of: " |
| 272 | "changes clean extras ignore list ls push pull rebuild sync"); |
| 273 | } |
| 274 | verify_all_options(); |
| 275 | zFossil = quoteFilename(g.nameOfExe); |
| 276 | db_multi_exec("CREATE TEMP TABLE repolist(name,tag);"); |
| 277 | if( useCheckouts ){ |
| 278 | db_multi_exec( |
| 279 | "INSERT INTO repolist " |
| 280 | "SELECT DISTINCT substr(name, 7), name COLLATE nocase" |
| 281 | " FROM global_config" |
| 282 | " WHERE substr(name, 1, 6)=='ckout:'" |
| 283 | " ORDER BY 1" |
| 284 | ); |
| 285 | }else{ |
| 286 | db_multi_exec( |
| 287 | "INSERT INTO repolist " |
| 288 | "SELECT DISTINCT substr(name, 6), name COLLATE nocase" |
| 289 | " FROM global_config" |
| 290 | " WHERE substr(name, 1, 5)=='repo:'" |
| 291 | " ORDER BY 1" |
| 292 | ); |
| 293 | } |
| 294 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 295 | db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1"); |
| 296 | while( db_step(&q)==SQLITE_ROW ){ |
| 297 | const char *zFilename = db_column_text(&q, 0); |
| 298 | if( file_access(zFilename, F_OK) |
| 299 | || !file_is_canonical(zFilename) |
| 300 | || (useCheckouts && file_isdir(zFilename)!=1) |
| @@ -300,10 +311,16 @@ | |
| 311 | zFilename); |
| 312 | } |
| 313 | zQFilename = quoteFilename(zFilename); |
| 314 | zSyscmd = mprintf("%s %s %s%s", |
| 315 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 316 | if( showLabel ){ |
| 317 | int len = (int)strlen(zFilename); |
| 318 | int nStar = 80 - (len + 15); |
| 319 | if( nStar<2 ) nStar = 1; |
| 320 | fossil_print("%.13c %s %.*c\n", '*', zFilename, nStar, '*'); |
| 321 | } |
| 322 | if( !quiet || dryRunFlag ){ |
| 323 | fossil_print("%s\n", zSyscmd); |
| 324 | fflush(stdout); |
| 325 | } |
| 326 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 327 |
+8
-8
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -29,11 +29,11 @@ | ||
| 29 | 29 | ** |
| 30 | 30 | ** List attachments. |
| 31 | 31 | ** Either one of tkt= or page= are supplied or neither. If neither |
| 32 | 32 | ** are given, all attachments are listed. If one is given, only |
| 33 | 33 | ** attachments for the designated ticket or wiki page are shown. |
| 34 | -** TICKETUUID must be complete | |
| 34 | +** TICKETUUID must be complete | |
| 35 | 35 | */ |
| 36 | 36 | void attachlist_page(void){ |
| 37 | 37 | const char *zPage = P("page"); |
| 38 | 38 | const char *zTkt = P("tkt"); |
| 39 | 39 | Blob sql; |
| @@ -53,11 +53,11 @@ | ||
| 53 | 53 | if( g.perm.RdWiki==0 ) login_needed(); |
| 54 | 54 | style_header("Attachments To %h", zPage); |
| 55 | 55 | blob_appendf(&sql, " WHERE target=%Q", zPage); |
| 56 | 56 | }else if( zTkt ){ |
| 57 | 57 | if( g.perm.RdTkt==0 ) login_needed(); |
| 58 | - style_header("Attachments To Ticket %.10s", zTkt); | |
| 58 | + style_header("Attachments To Ticket %S", zTkt); | |
| 59 | 59 | blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt); |
| 60 | 60 | }else{ |
| 61 | 61 | if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed(); |
| 62 | 62 | style_header("All Attachments"); |
| 63 | 63 | } |
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | int attachid = db_column_int(&q, 7); |
| 76 | 76 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 77 | 77 | int i; |
| 78 | 78 | char *zUrlTail; |
| 79 | 79 | for(i=0; zFilename[i]; i++){ |
| 80 | - if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ | |
| 80 | + if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ | |
| 81 | 81 | zFilename = &zFilename[i+1]; |
| 82 | 82 | i = -1; |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| @@ -253,11 +253,11 @@ | ||
| 253 | 253 | zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>", |
| 254 | 254 | g.zTop, zPage, zPage); |
| 255 | 255 | }else{ |
| 256 | 256 | if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed(); |
| 257 | 257 | if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){ |
| 258 | - zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" | |
| 258 | + zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" | |
| 259 | 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | 261 | } |
| 262 | 262 | zTarget = zTkt; |
| 263 | 263 | zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", |
| @@ -445,11 +445,11 @@ | ||
| 445 | 445 | @ <p>Confirm you want to delete the attachment shown below. |
| 446 | 446 | @ <input type="submit" name="confirm" value="Confirm"> |
| 447 | 447 | @ </form> |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - isModerator = g.perm.Admin || | |
| 450 | + isModerator = g.perm.Admin || | |
| 451 | 451 | (zTktUuid && g.perm.ModTkt) || |
| 452 | 452 | (zWikiName && g.perm.ModWiki); |
| 453 | 453 | if( isModerator && (zModAction = P("modaction"))!=0 ){ |
| 454 | 454 | if( strcmp(zModAction,"delete")==0 ){ |
| 455 | 455 | moderation_disapprove(rid); |
| @@ -500,11 +500,11 @@ | ||
| 500 | 500 | if( g.perm.Setup ){ |
| 501 | 501 | @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr> |
| 502 | 502 | } |
| 503 | 503 | @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr> |
| 504 | 504 | @ </table> |
| 505 | - | |
| 505 | + | |
| 506 | 506 | if( isModerator && modPending ){ |
| 507 | 507 | @ <div class="section">Moderation</div> |
| 508 | 508 | @ <blockquote> |
| 509 | 509 | form_begin(0, "%R/ainfo/%s", zUuid); |
| 510 | 510 | @ <label><input type="radio" name="modaction" value="delete"> |
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | db_prepare(&q, |
| 558 | 558 | "SELECT datetime(mtime%s), filename, user," |
| 559 | 559 | " (SELECT uuid FROM blob WHERE rid=attachid), src" |
| 560 | 560 | " FROM attachment" |
| 561 | 561 | " WHERE isLatest AND src!='' AND target=%Q" |
| 562 | - " ORDER BY mtime DESC", | |
| 562 | + " ORDER BY mtime DESC", | |
| 563 | 563 | timeline_utc(), zTarget |
| 564 | 564 | ); |
| 565 | 565 | while( db_step(&q)==SQLITE_ROW ){ |
| 566 | 566 | const char *zDate = db_column_text(&q, 0); |
| 567 | 567 | const char *zFile = db_column_text(&q, 1); |
| @@ -582,7 +582,7 @@ | ||
| 582 | 582 | } |
| 583 | 583 | if( cnt ){ |
| 584 | 584 | @ </ul> |
| 585 | 585 | } |
| 586 | 586 | db_finalize(&q); |
| 587 | - | |
| 587 | + | |
| 588 | 588 | } |
| 589 | 589 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -29,11 +29,11 @@ | |
| 29 | ** |
| 30 | ** List attachments. |
| 31 | ** Either one of tkt= or page= are supplied or neither. If neither |
| 32 | ** are given, all attachments are listed. If one is given, only |
| 33 | ** attachments for the designated ticket or wiki page are shown. |
| 34 | ** TICKETUUID must be complete |
| 35 | */ |
| 36 | void attachlist_page(void){ |
| 37 | const char *zPage = P("page"); |
| 38 | const char *zTkt = P("tkt"); |
| 39 | Blob sql; |
| @@ -53,11 +53,11 @@ | |
| 53 | if( g.perm.RdWiki==0 ) login_needed(); |
| 54 | style_header("Attachments To %h", zPage); |
| 55 | blob_appendf(&sql, " WHERE target=%Q", zPage); |
| 56 | }else if( zTkt ){ |
| 57 | if( g.perm.RdTkt==0 ) login_needed(); |
| 58 | style_header("Attachments To Ticket %.10s", zTkt); |
| 59 | blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt); |
| 60 | }else{ |
| 61 | if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed(); |
| 62 | style_header("All Attachments"); |
| 63 | } |
| @@ -75,11 +75,11 @@ | |
| 75 | int attachid = db_column_int(&q, 7); |
| 76 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 77 | int i; |
| 78 | char *zUrlTail; |
| 79 | for(i=0; zFilename[i]; i++){ |
| 80 | if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ |
| 81 | zFilename = &zFilename[i+1]; |
| 82 | i = -1; |
| 83 | } |
| 84 | } |
| 85 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| @@ -253,11 +253,11 @@ | |
| 253 | zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>", |
| 254 | g.zTop, zPage, zPage); |
| 255 | }else{ |
| 256 | if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed(); |
| 257 | if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){ |
| 258 | zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" |
| 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | } |
| 262 | zTarget = zTkt; |
| 263 | zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", |
| @@ -445,11 +445,11 @@ | |
| 445 | @ <p>Confirm you want to delete the attachment shown below. |
| 446 | @ <input type="submit" name="confirm" value="Confirm"> |
| 447 | @ </form> |
| 448 | } |
| 449 | |
| 450 | isModerator = g.perm.Admin || |
| 451 | (zTktUuid && g.perm.ModTkt) || |
| 452 | (zWikiName && g.perm.ModWiki); |
| 453 | if( isModerator && (zModAction = P("modaction"))!=0 ){ |
| 454 | if( strcmp(zModAction,"delete")==0 ){ |
| 455 | moderation_disapprove(rid); |
| @@ -500,11 +500,11 @@ | |
| 500 | if( g.perm.Setup ){ |
| 501 | @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr> |
| 502 | } |
| 503 | @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr> |
| 504 | @ </table> |
| 505 | |
| 506 | if( isModerator && modPending ){ |
| 507 | @ <div class="section">Moderation</div> |
| 508 | @ <blockquote> |
| 509 | form_begin(0, "%R/ainfo/%s", zUuid); |
| 510 | @ <label><input type="radio" name="modaction" value="delete"> |
| @@ -557,11 +557,11 @@ | |
| 557 | db_prepare(&q, |
| 558 | "SELECT datetime(mtime%s), filename, user," |
| 559 | " (SELECT uuid FROM blob WHERE rid=attachid), src" |
| 560 | " FROM attachment" |
| 561 | " WHERE isLatest AND src!='' AND target=%Q" |
| 562 | " ORDER BY mtime DESC", |
| 563 | timeline_utc(), zTarget |
| 564 | ); |
| 565 | while( db_step(&q)==SQLITE_ROW ){ |
| 566 | const char *zDate = db_column_text(&q, 0); |
| 567 | const char *zFile = db_column_text(&q, 1); |
| @@ -582,7 +582,7 @@ | |
| 582 | } |
| 583 | if( cnt ){ |
| 584 | @ </ul> |
| 585 | } |
| 586 | db_finalize(&q); |
| 587 | |
| 588 | } |
| 589 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -29,11 +29,11 @@ | |
| 29 | ** |
| 30 | ** List attachments. |
| 31 | ** Either one of tkt= or page= are supplied or neither. If neither |
| 32 | ** are given, all attachments are listed. If one is given, only |
| 33 | ** attachments for the designated ticket or wiki page are shown. |
| 34 | ** TICKETUUID must be complete |
| 35 | */ |
| 36 | void attachlist_page(void){ |
| 37 | const char *zPage = P("page"); |
| 38 | const char *zTkt = P("tkt"); |
| 39 | Blob sql; |
| @@ -53,11 +53,11 @@ | |
| 53 | if( g.perm.RdWiki==0 ) login_needed(); |
| 54 | style_header("Attachments To %h", zPage); |
| 55 | blob_appendf(&sql, " WHERE target=%Q", zPage); |
| 56 | }else if( zTkt ){ |
| 57 | if( g.perm.RdTkt==0 ) login_needed(); |
| 58 | style_header("Attachments To Ticket %S", zTkt); |
| 59 | blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt); |
| 60 | }else{ |
| 61 | if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed(); |
| 62 | style_header("All Attachments"); |
| 63 | } |
| @@ -75,11 +75,11 @@ | |
| 75 | int attachid = db_column_int(&q, 7); |
| 76 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 77 | int i; |
| 78 | char *zUrlTail; |
| 79 | for(i=0; zFilename[i]; i++){ |
| 80 | if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ |
| 81 | zFilename = &zFilename[i+1]; |
| 82 | i = -1; |
| 83 | } |
| 84 | } |
| 85 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| @@ -253,11 +253,11 @@ | |
| 253 | zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>", |
| 254 | g.zTop, zPage, zPage); |
| 255 | }else{ |
| 256 | if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed(); |
| 257 | if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){ |
| 258 | zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" |
| 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | } |
| 262 | zTarget = zTkt; |
| 263 | zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", |
| @@ -445,11 +445,11 @@ | |
| 445 | @ <p>Confirm you want to delete the attachment shown below. |
| 446 | @ <input type="submit" name="confirm" value="Confirm"> |
| 447 | @ </form> |
| 448 | } |
| 449 | |
| 450 | isModerator = g.perm.Admin || |
| 451 | (zTktUuid && g.perm.ModTkt) || |
| 452 | (zWikiName && g.perm.ModWiki); |
| 453 | if( isModerator && (zModAction = P("modaction"))!=0 ){ |
| 454 | if( strcmp(zModAction,"delete")==0 ){ |
| 455 | moderation_disapprove(rid); |
| @@ -500,11 +500,11 @@ | |
| 500 | if( g.perm.Setup ){ |
| 501 | @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr> |
| 502 | } |
| 503 | @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr> |
| 504 | @ </table> |
| 505 | |
| 506 | if( isModerator && modPending ){ |
| 507 | @ <div class="section">Moderation</div> |
| 508 | @ <blockquote> |
| 509 | form_begin(0, "%R/ainfo/%s", zUuid); |
| 510 | @ <label><input type="radio" name="modaction" value="delete"> |
| @@ -557,11 +557,11 @@ | |
| 557 | db_prepare(&q, |
| 558 | "SELECT datetime(mtime%s), filename, user," |
| 559 | " (SELECT uuid FROM blob WHERE rid=attachid), src" |
| 560 | " FROM attachment" |
| 561 | " WHERE isLatest AND src!='' AND target=%Q" |
| 562 | " ORDER BY mtime DESC", |
| 563 | timeline_utc(), zTarget |
| 564 | ); |
| 565 | while( db_step(&q)==SQLITE_ROW ){ |
| 566 | const char *zDate = db_column_text(&q, 0); |
| 567 | const char *zFile = db_column_text(&q, 1); |
| @@ -582,7 +582,7 @@ | |
| 582 | } |
| 583 | if( cnt ){ |
| 584 | @ </ul> |
| 585 | } |
| 586 | db_finalize(&q); |
| 587 | |
| 588 | } |
| 589 |
+55
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1004,10 +1004,65 @@ | ||
| 1004 | 1004 | else if( z[i+1]!='\n' ) z[j++] = '\n'; |
| 1005 | 1005 | } |
| 1006 | 1006 | z[j] = 0; |
| 1007 | 1007 | p->nUsed = j; |
| 1008 | 1008 | } |
| 1009 | + | |
| 1010 | +/* | |
| 1011 | +** Convert blob from cp1252 to UTF-8. As cp1252 is a superset | |
| 1012 | +** of iso8859-1, this is useful on UNIX as well. | |
| 1013 | +** | |
| 1014 | +** This table contains the character translations for 0x80..0xA0. | |
| 1015 | +*/ | |
| 1016 | + | |
| 1017 | +static const unsigned short cp1252[32] = { | |
| 1018 | + 0x20ac, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, | |
| 1019 | + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x8D, 0x017D, 0x8F, | |
| 1020 | + 0x90, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, | |
| 1021 | + 0x2DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x9D, 0x017E, 0x0178 | |
| 1022 | +}; | |
| 1023 | + | |
| 1024 | +void blob_cp1252_to_utf8(Blob *p){ | |
| 1025 | + unsigned char *z = (unsigned char *)p->aData; | |
| 1026 | + int j = p->nUsed; | |
| 1027 | + int i, n; | |
| 1028 | + for(i=n=0; i<j; i++){ | |
| 1029 | + if( z[i]>=0x80 ){ | |
| 1030 | + if( (z[i]<0xa0) && (cp1252[z[i]&0x1f]>=0x800) ){ | |
| 1031 | + n++; | |
| 1032 | + } | |
| 1033 | + n++; | |
| 1034 | + } | |
| 1035 | + } | |
| 1036 | + j += n; | |
| 1037 | + if( j>=p->nAlloc ){ | |
| 1038 | + blob_resize(p, j); | |
| 1039 | + z = (unsigned char *)p->aData; | |
| 1040 | + } | |
| 1041 | + p->nUsed = j; | |
| 1042 | + z[j] = 0; | |
| 1043 | + while( j>i ){ | |
| 1044 | + if( z[--i]>=0x80 ){ | |
| 1045 | + if( z[i]<0xa0 ){ | |
| 1046 | + unsigned short sym = cp1252[z[i]&0x1f]; | |
| 1047 | + if( sym>=0x800 ){ | |
| 1048 | + z[--j] = 0x80 | (sym&0x3f); | |
| 1049 | + z[--j] = 0x80 | ((sym>>6)&0x3f); | |
| 1050 | + z[--j] = 0xe0 | (sym>>12); | |
| 1051 | + }else{ | |
| 1052 | + z[--j] = 0x80 | (sym&0x3f); | |
| 1053 | + z[--j] = 0xc0 | (sym>>6); | |
| 1054 | + } | |
| 1055 | + }else{ | |
| 1056 | + z[--j] = 0x80 | (z[i]&0x3f); | |
| 1057 | + z[--j] = 0xC0 | (z[i]>>6); | |
| 1058 | + } | |
| 1059 | + }else{ | |
| 1060 | + z[--j] = z[i]; | |
| 1061 | + } | |
| 1062 | + } | |
| 1063 | +} | |
| 1009 | 1064 | |
| 1010 | 1065 | /* |
| 1011 | 1066 | ** Shell-escape the given string. Append the result to a blob. |
| 1012 | 1067 | */ |
| 1013 | 1068 | void shell_escape(Blob *pBlob, const char *zIn){ |
| 1014 | 1069 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1004,10 +1004,65 @@ | |
| 1004 | else if( z[i+1]!='\n' ) z[j++] = '\n'; |
| 1005 | } |
| 1006 | z[j] = 0; |
| 1007 | p->nUsed = j; |
| 1008 | } |
| 1009 | |
| 1010 | /* |
| 1011 | ** Shell-escape the given string. Append the result to a blob. |
| 1012 | */ |
| 1013 | void shell_escape(Blob *pBlob, const char *zIn){ |
| 1014 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1004,10 +1004,65 @@ | |
| 1004 | else if( z[i+1]!='\n' ) z[j++] = '\n'; |
| 1005 | } |
| 1006 | z[j] = 0; |
| 1007 | p->nUsed = j; |
| 1008 | } |
| 1009 | |
| 1010 | /* |
| 1011 | ** Convert blob from cp1252 to UTF-8. As cp1252 is a superset |
| 1012 | ** of iso8859-1, this is useful on UNIX as well. |
| 1013 | ** |
| 1014 | ** This table contains the character translations for 0x80..0xA0. |
| 1015 | */ |
| 1016 | |
| 1017 | static const unsigned short cp1252[32] = { |
| 1018 | 0x20ac, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, |
| 1019 | 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x8D, 0x017D, 0x8F, |
| 1020 | 0x90, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, |
| 1021 | 0x2DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x9D, 0x017E, 0x0178 |
| 1022 | }; |
| 1023 | |
| 1024 | void blob_cp1252_to_utf8(Blob *p){ |
| 1025 | unsigned char *z = (unsigned char *)p->aData; |
| 1026 | int j = p->nUsed; |
| 1027 | int i, n; |
| 1028 | for(i=n=0; i<j; i++){ |
| 1029 | if( z[i]>=0x80 ){ |
| 1030 | if( (z[i]<0xa0) && (cp1252[z[i]&0x1f]>=0x800) ){ |
| 1031 | n++; |
| 1032 | } |
| 1033 | n++; |
| 1034 | } |
| 1035 | } |
| 1036 | j += n; |
| 1037 | if( j>=p->nAlloc ){ |
| 1038 | blob_resize(p, j); |
| 1039 | z = (unsigned char *)p->aData; |
| 1040 | } |
| 1041 | p->nUsed = j; |
| 1042 | z[j] = 0; |
| 1043 | while( j>i ){ |
| 1044 | if( z[--i]>=0x80 ){ |
| 1045 | if( z[i]<0xa0 ){ |
| 1046 | unsigned short sym = cp1252[z[i]&0x1f]; |
| 1047 | if( sym>=0x800 ){ |
| 1048 | z[--j] = 0x80 | (sym&0x3f); |
| 1049 | z[--j] = 0x80 | ((sym>>6)&0x3f); |
| 1050 | z[--j] = 0xe0 | (sym>>12); |
| 1051 | }else{ |
| 1052 | z[--j] = 0x80 | (sym&0x3f); |
| 1053 | z[--j] = 0xc0 | (sym>>6); |
| 1054 | } |
| 1055 | }else{ |
| 1056 | z[--j] = 0x80 | (z[i]&0x3f); |
| 1057 | z[--j] = 0xC0 | (z[i]>>6); |
| 1058 | } |
| 1059 | }else{ |
| 1060 | z[--j] = z[i]; |
| 1061 | } |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | /* |
| 1066 | ** Shell-escape the given string. Append the result to a blob. |
| 1067 | */ |
| 1068 | void shell_escape(Blob *pBlob, const char *zIn){ |
| 1069 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -334,11 +334,11 @@ | ||
| 334 | 334 | @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed")) |
| 335 | 335 | @ closed branch</a></div> is a branch with only |
| 336 | 336 | @ <div class="sideboxDescribed">%z(href("leaves?closed")) |
| 337 | 337 | @ closed leaves</a></div>. |
| 338 | 338 | @ Closed branches are fixed and do not change (unless they are first |
| 339 | - @ reopened)</li> | |
| 339 | + @ reopened).</li> | |
| 340 | 340 | @ </ol> |
| 341 | 341 | style_sidebox_end(); |
| 342 | 342 | |
| 343 | 343 | branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0)); |
| 344 | 344 | cnt = 0; |
| 345 | 345 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -334,11 +334,11 @@ | |
| 334 | @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed")) |
| 335 | @ closed branch</a></div> is a branch with only |
| 336 | @ <div class="sideboxDescribed">%z(href("leaves?closed")) |
| 337 | @ closed leaves</a></div>. |
| 338 | @ Closed branches are fixed and do not change (unless they are first |
| 339 | @ reopened)</li> |
| 340 | @ </ol> |
| 341 | style_sidebox_end(); |
| 342 | |
| 343 | branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0)); |
| 344 | cnt = 0; |
| 345 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -334,11 +334,11 @@ | |
| 334 | @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed")) |
| 335 | @ closed branch</a></div> is a branch with only |
| 336 | @ <div class="sideboxDescribed">%z(href("leaves?closed")) |
| 337 | @ closed leaves</a></div>. |
| 338 | @ Closed branches are fixed and do not change (unless they are first |
| 339 | @ reopened).</li> |
| 340 | @ </ol> |
| 341 | style_sidebox_end(); |
| 342 | |
| 343 | branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0)); |
| 344 | cnt = 0; |
| 345 |
+1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -179,11 +179,11 @@ | ||
| 179 | 179 | if( linkTip ){ |
| 180 | 180 | style_submenu_element("Tip", "Tip", "%s", |
| 181 | 181 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 182 | 182 | } |
| 183 | 183 | if( zCI ){ |
| 184 | - @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%.10s(zUuid)</a>] | |
| 184 | + @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] | |
| 185 | 185 | @ %s(blob_str(&dirname))</h2> |
| 186 | 186 | zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix); |
| 187 | 187 | if( nD==0 ){ |
| 188 | 188 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 189 | 189 | zUuid); |
| 190 | 190 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -179,11 +179,11 @@ | |
| 179 | if( linkTip ){ |
| 180 | style_submenu_element("Tip", "Tip", "%s", |
| 181 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 182 | } |
| 183 | if( zCI ){ |
| 184 | @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%.10s(zUuid)</a>] |
| 185 | @ %s(blob_str(&dirname))</h2> |
| 186 | zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix); |
| 187 | if( nD==0 ){ |
| 188 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 189 | zUuid); |
| 190 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -179,11 +179,11 @@ | |
| 179 | if( linkTip ){ |
| 180 | style_submenu_element("Tip", "Tip", "%s", |
| 181 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 182 | } |
| 183 | if( zCI ){ |
| 184 | @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] |
| 185 | @ %s(blob_str(&dirname))</h2> |
| 186 | zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix); |
| 187 | if( nD==0 ){ |
| 188 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 189 | zUuid); |
| 190 |
+16
-5
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -928,11 +928,11 @@ | ||
| 928 | 928 | " WHERE datetime(mtime)>=%Q" |
| 929 | 929 | " AND type='ci' AND objid=%d", |
| 930 | 930 | zDate, rid |
| 931 | 931 | ); |
| 932 | 932 | if( b ){ |
| 933 | - fossil_fatal("ancestor check-in [%.10s] (%s) is not older (clock skew?)" | |
| 933 | + fossil_fatal("ancestor check-in [%S] (%s) is not older (clock skew?)" | |
| 934 | 934 | " Use --allow-older to override.", zUuid, zDate); |
| 935 | 935 | } |
| 936 | 936 | #endif |
| 937 | 937 | } |
| 938 | 938 | |
| @@ -1296,11 +1296,10 @@ | ||
| 1296 | 1296 | }else if( fHasInvalidUtf8 ){ |
| 1297 | 1297 | if( encodingOk ){ |
| 1298 | 1298 | return 0; /* We don't want encoding warnings for this file. */ |
| 1299 | 1299 | } |
| 1300 | 1300 | zWarning = "invalid UTF-8"; |
| 1301 | - zConvert = ""; /* Possible conversion to UTF-8 not yet implemented. */ | |
| 1302 | 1301 | zDisable = "\"encoding-glob\" setting"; |
| 1303 | 1302 | }else if( fHasAnyCr ){ |
| 1304 | 1303 | if( crnlOk ){ |
| 1305 | 1304 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 1306 | 1305 | } |
| @@ -1341,10 +1340,12 @@ | ||
| 1341 | 1340 | if( fUnicode ) { |
| 1342 | 1341 | int bomSize; |
| 1343 | 1342 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 1344 | 1343 | fwrite(bom, 1, bomSize, f); |
| 1345 | 1344 | blob_to_utf8_no_bom(p, 0); |
| 1345 | + }else if( fHasInvalidUtf8 ){ | |
| 1346 | + blob_cp1252_to_utf8(p); | |
| 1346 | 1347 | } |
| 1347 | 1348 | if( fHasAnyCr ){ |
| 1348 | 1349 | blob_to_lf_only(p); |
| 1349 | 1350 | } |
| 1350 | 1351 | fwrite(blob_buffer(p), 1, blob_size(p), f); |
| @@ -1676,15 +1677,25 @@ | ||
| 1676 | 1677 | ){ |
| 1677 | 1678 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1678 | 1679 | } |
| 1679 | 1680 | |
| 1680 | 1681 | /* |
| 1681 | - ** Do not allow a commit against a closed leaf | |
| 1682 | + ** Do not allow a commit against a closed leaf unless the commit | |
| 1683 | + ** ends up on a different branch. | |
| 1682 | 1684 | */ |
| 1683 | - if( db_exists("SELECT 1 FROM tagxref" | |
| 1685 | + if( | |
| 1686 | + /* parent checkin has the "closed" tag... */ | |
| 1687 | + db_exists("SELECT 1 FROM tagxref" | |
| 1684 | 1688 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 1685 | - TAG_CLOSED, vid) ){ | |
| 1689 | + TAG_CLOSED, vid) | |
| 1690 | + /* ... and the new checkin has no --branch option or the --branch | |
| 1691 | + ** option does not actually change the branch */ | |
| 1692 | + && (sCiInfo.zBranch==0 | |
| 1693 | + || db_exists("SELECT 1 FROM tagxref" | |
| 1694 | + " WHERE tagid=%d AND rid=%d AND tagtype>0" | |
| 1695 | + " AND value=%Q", TAG_BRANCH, vid, sCiInfo.zBranch)) | |
| 1696 | + ){ | |
| 1686 | 1697 | fossil_fatal("cannot commit against a closed leaf"); |
| 1687 | 1698 | } |
| 1688 | 1699 | |
| 1689 | 1700 | if( useCksum ) vfile_aggregate_checksum_disk(vid, &cksum1); |
| 1690 | 1701 | if( zComment ){ |
| 1691 | 1702 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -928,11 +928,11 @@ | |
| 928 | " WHERE datetime(mtime)>=%Q" |
| 929 | " AND type='ci' AND objid=%d", |
| 930 | zDate, rid |
| 931 | ); |
| 932 | if( b ){ |
| 933 | fossil_fatal("ancestor check-in [%.10s] (%s) is not older (clock skew?)" |
| 934 | " Use --allow-older to override.", zUuid, zDate); |
| 935 | } |
| 936 | #endif |
| 937 | } |
| 938 | |
| @@ -1296,11 +1296,10 @@ | |
| 1296 | }else if( fHasInvalidUtf8 ){ |
| 1297 | if( encodingOk ){ |
| 1298 | return 0; /* We don't want encoding warnings for this file. */ |
| 1299 | } |
| 1300 | zWarning = "invalid UTF-8"; |
| 1301 | zConvert = ""; /* Possible conversion to UTF-8 not yet implemented. */ |
| 1302 | zDisable = "\"encoding-glob\" setting"; |
| 1303 | }else if( fHasAnyCr ){ |
| 1304 | if( crnlOk ){ |
| 1305 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 1306 | } |
| @@ -1341,10 +1340,12 @@ | |
| 1341 | if( fUnicode ) { |
| 1342 | int bomSize; |
| 1343 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 1344 | fwrite(bom, 1, bomSize, f); |
| 1345 | blob_to_utf8_no_bom(p, 0); |
| 1346 | } |
| 1347 | if( fHasAnyCr ){ |
| 1348 | blob_to_lf_only(p); |
| 1349 | } |
| 1350 | fwrite(blob_buffer(p), 1, blob_size(p), f); |
| @@ -1676,15 +1677,25 @@ | |
| 1676 | ){ |
| 1677 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1678 | } |
| 1679 | |
| 1680 | /* |
| 1681 | ** Do not allow a commit against a closed leaf |
| 1682 | */ |
| 1683 | if( db_exists("SELECT 1 FROM tagxref" |
| 1684 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 1685 | TAG_CLOSED, vid) ){ |
| 1686 | fossil_fatal("cannot commit against a closed leaf"); |
| 1687 | } |
| 1688 | |
| 1689 | if( useCksum ) vfile_aggregate_checksum_disk(vid, &cksum1); |
| 1690 | if( zComment ){ |
| 1691 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -928,11 +928,11 @@ | |
| 928 | " WHERE datetime(mtime)>=%Q" |
| 929 | " AND type='ci' AND objid=%d", |
| 930 | zDate, rid |
| 931 | ); |
| 932 | if( b ){ |
| 933 | fossil_fatal("ancestor check-in [%S] (%s) is not older (clock skew?)" |
| 934 | " Use --allow-older to override.", zUuid, zDate); |
| 935 | } |
| 936 | #endif |
| 937 | } |
| 938 | |
| @@ -1296,11 +1296,10 @@ | |
| 1296 | }else if( fHasInvalidUtf8 ){ |
| 1297 | if( encodingOk ){ |
| 1298 | return 0; /* We don't want encoding warnings for this file. */ |
| 1299 | } |
| 1300 | zWarning = "invalid UTF-8"; |
| 1301 | zDisable = "\"encoding-glob\" setting"; |
| 1302 | }else if( fHasAnyCr ){ |
| 1303 | if( crnlOk ){ |
| 1304 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 1305 | } |
| @@ -1341,10 +1340,12 @@ | |
| 1340 | if( fUnicode ) { |
| 1341 | int bomSize; |
| 1342 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 1343 | fwrite(bom, 1, bomSize, f); |
| 1344 | blob_to_utf8_no_bom(p, 0); |
| 1345 | }else if( fHasInvalidUtf8 ){ |
| 1346 | blob_cp1252_to_utf8(p); |
| 1347 | } |
| 1348 | if( fHasAnyCr ){ |
| 1349 | blob_to_lf_only(p); |
| 1350 | } |
| 1351 | fwrite(blob_buffer(p), 1, blob_size(p), f); |
| @@ -1676,15 +1677,25 @@ | |
| 1677 | ){ |
| 1678 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1679 | } |
| 1680 | |
| 1681 | /* |
| 1682 | ** Do not allow a commit against a closed leaf unless the commit |
| 1683 | ** ends up on a different branch. |
| 1684 | */ |
| 1685 | if( |
| 1686 | /* parent checkin has the "closed" tag... */ |
| 1687 | db_exists("SELECT 1 FROM tagxref" |
| 1688 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 1689 | TAG_CLOSED, vid) |
| 1690 | /* ... and the new checkin has no --branch option or the --branch |
| 1691 | ** option does not actually change the branch */ |
| 1692 | && (sCiInfo.zBranch==0 |
| 1693 | || db_exists("SELECT 1 FROM tagxref" |
| 1694 | " WHERE tagid=%d AND rid=%d AND tagtype>0" |
| 1695 | " AND value=%Q", TAG_BRANCH, vid, sCiInfo.zBranch)) |
| 1696 | ){ |
| 1697 | fossil_fatal("cannot commit against a closed leaf"); |
| 1698 | } |
| 1699 | |
| 1700 | if( useCksum ) vfile_aggregate_checksum_disk(vid, &cksum1); |
| 1701 | if( zComment ){ |
| 1702 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -67,11 +67,11 @@ | ||
| 67 | 67 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 68 | 68 | if( vid==0 ){ |
| 69 | 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | 70 | } |
| 71 | 71 | if( !is_a_version(vid) ){ |
| 72 | - fossil_fatal("object [%.10s] is not a check-in", blob_str(&uuid)); | |
| 72 | + fossil_fatal("object [%S] is not a check-in", blob_str(&uuid)); | |
| 73 | 73 | } |
| 74 | 74 | if( load_vfile_from_rid(vid) && !forceMissingFlag ){ |
| 75 | 75 | fossil_fatal("missing content, unable to checkout"); |
| 76 | 76 | }; |
| 77 | 77 | return vid; |
| 78 | 78 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 68 | if( vid==0 ){ |
| 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | } |
| 71 | if( !is_a_version(vid) ){ |
| 72 | fossil_fatal("object [%.10s] is not a check-in", blob_str(&uuid)); |
| 73 | } |
| 74 | if( load_vfile_from_rid(vid) && !forceMissingFlag ){ |
| 75 | fossil_fatal("missing content, unable to checkout"); |
| 76 | }; |
| 77 | return vid; |
| 78 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 68 | if( vid==0 ){ |
| 69 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 70 | } |
| 71 | if( !is_a_version(vid) ){ |
| 72 | fossil_fatal("object [%S] is not a check-in", blob_str(&uuid)); |
| 73 | } |
| 74 | if( load_vfile_from_rid(vid) && !forceMissingFlag ){ |
| 75 | fossil_fatal("missing content, unable to checkout"); |
| 76 | }; |
| 77 | return vid; |
| 78 |
+1
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -195,10 +195,11 @@ | ||
| 195 | 195 | } |
| 196 | 196 | db_begin_transaction(); |
| 197 | 197 | fossil_print("Rebuilding repository meta-data...\n"); |
| 198 | 198 | rebuild_db(0, 1, 0); |
| 199 | 199 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 200 | + fossil_print("server-id: %s\n", db_get("server-code", 0)); | |
| 200 | 201 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 201 | 202 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 202 | 203 | db_end_transaction(0); |
| 203 | 204 | } |
| 204 | 205 | |
| 205 | 206 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -195,10 +195,11 @@ | |
| 195 | } |
| 196 | db_begin_transaction(); |
| 197 | fossil_print("Rebuilding repository meta-data...\n"); |
| 198 | rebuild_db(0, 1, 0); |
| 199 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 200 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 201 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 202 | db_end_transaction(0); |
| 203 | } |
| 204 | |
| 205 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -195,10 +195,11 @@ | |
| 195 | } |
| 196 | db_begin_transaction(); |
| 197 | fossil_print("Rebuilding repository meta-data...\n"); |
| 198 | rebuild_db(0, 1, 0); |
| 199 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 200 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 201 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 202 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 203 | db_end_transaction(0); |
| 204 | } |
| 205 | |
| 206 |
+3
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -23,10 +23,13 @@ | ||
| 23 | 23 | #include <assert.h> |
| 24 | 24 | #ifdef _WIN32 |
| 25 | 25 | # include <windows.h> |
| 26 | 26 | #else |
| 27 | 27 | # include <termios.h> |
| 28 | +# if defined(TIOCGWINSZ) | |
| 29 | +# include <sys/ioctl.h> | |
| 30 | +# endif | |
| 28 | 31 | #endif |
| 29 | 32 | |
| 30 | 33 | #if INTERFACE |
| 31 | 34 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 32 | 35 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 33 | 36 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -23,10 +23,13 @@ | |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | #else |
| 27 | # include <termios.h> |
| 28 | #endif |
| 29 | |
| 30 | #if INTERFACE |
| 31 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 32 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 33 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -23,10 +23,13 @@ | |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | #else |
| 27 | # include <termios.h> |
| 28 | # if defined(TIOCGWINSZ) |
| 29 | # include <sys/ioctl.h> |
| 30 | # endif |
| 31 | #endif |
| 32 | |
| 33 | #if INTERFACE |
| 34 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 35 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 36 |
+3
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -23,10 +23,13 @@ | ||
| 23 | 23 | #include <assert.h> |
| 24 | 24 | #ifdef _WIN32 |
| 25 | 25 | # include <windows.h> |
| 26 | 26 | #else |
| 27 | 27 | # include <termios.h> |
| 28 | +# if defined(TIOCGWINSZ) | |
| 29 | +# include <sys/ioctl.h> | |
| 30 | +# endif | |
| 28 | 31 | #endif |
| 29 | 32 | |
| 30 | 33 | #if INTERFACE |
| 31 | 34 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 32 | 35 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 33 | 36 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -23,10 +23,13 @@ | |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | #else |
| 27 | # include <termios.h> |
| 28 | #endif |
| 29 | |
| 30 | #if INTERFACE |
| 31 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 32 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 33 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -23,10 +23,13 @@ | |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | #else |
| 27 | # include <termios.h> |
| 28 | # if defined(TIOCGWINSZ) |
| 29 | # include <sys/ioctl.h> |
| 30 | # endif |
| 31 | #endif |
| 32 | |
| 33 | #if INTERFACE |
| 34 | #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags. */ |
| 35 | #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */ |
| 36 |
+5
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -24,10 +24,15 @@ | ||
| 24 | 24 | #define _LARGE_FILE 1 |
| 25 | 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | 27 | #endif |
| 28 | 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | + | |
| 30 | +/* Needed for various definitions... */ | |
| 31 | +#ifndef _GNU_SOURCE | |
| 32 | +# define _GNU_SOURCE | |
| 33 | +#endif | |
| 29 | 34 | |
| 30 | 35 | /* Make sure that in Win32 MinGW builds, _USE_32BIT_TIME_T is always defined. */ |
| 31 | 36 | #if defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER) && !defined(_USE_32BIT_TIME_T) |
| 32 | 37 | # define _USE_32BIT_TIME_T |
| 33 | 38 | #endif |
| 34 | 39 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -24,10 +24,15 @@ | |
| 24 | #define _LARGE_FILE 1 |
| 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | #endif |
| 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | |
| 30 | /* Make sure that in Win32 MinGW builds, _USE_32BIT_TIME_T is always defined. */ |
| 31 | #if defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER) && !defined(_USE_32BIT_TIME_T) |
| 32 | # define _USE_32BIT_TIME_T |
| 33 | #endif |
| 34 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -24,10 +24,15 @@ | |
| 24 | #define _LARGE_FILE 1 |
| 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | #endif |
| 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | |
| 30 | /* Needed for various definitions... */ |
| 31 | #ifndef _GNU_SOURCE |
| 32 | # define _GNU_SOURCE |
| 33 | #endif |
| 34 | |
| 35 | /* Make sure that in Win32 MinGW builds, _USE_32BIT_TIME_T is always defined. */ |
| 36 | #if defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER) && !defined(_USE_32BIT_TIME_T) |
| 37 | # define _USE_32BIT_TIME_T |
| 38 | #endif |
| 39 |
M
src/db.c
+3
-8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1465,29 +1465,24 @@ | ||
| 1465 | 1465 | ** |
| 1466 | 1466 | ** Options: |
| 1467 | 1467 | ** --template FILE copy settings from repository file |
| 1468 | 1468 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1469 | 1469 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1470 | -** (overrides --empty as well) | |
| 1471 | -** --empty Do not create an initial empty checkin. | |
| 1470 | +** (default: do not create an initial checkin) | |
| 1472 | 1471 | ** |
| 1473 | 1472 | ** See also: clone |
| 1474 | 1473 | */ |
| 1475 | 1474 | void create_repository_cmd(void){ |
| 1476 | 1475 | char *zPassword; |
| 1477 | 1476 | const char *zTemplate; /* Repository from which to copy settings */ |
| 1478 | 1477 | const char *zDate; /* Date of the initial check-in */ |
| 1479 | 1478 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1480 | - char const *zCreateEmpty; /* --empty flag set? */ | |
| 1481 | 1479 | |
| 1482 | 1480 | zTemplate = find_option("template",0,1); |
| 1483 | 1481 | zDate = find_option("date-override",0,1); |
| 1484 | 1482 | zDefaultUser = find_option("admin-user","A",1); |
| 1485 | - zCreateEmpty = find_option("empty", 0, 0); | |
| 1486 | - if( !zDate && !zCreateEmpty ){ | |
| 1487 | - zDate = "now"; | |
| 1488 | - } | |
| 1483 | + find_option("empty", 0, 0); /* deprecated */ | |
| 1489 | 1484 | if( g.argc!=3 ){ |
| 1490 | 1485 | usage("REPOSITORY-NAME"); |
| 1491 | 1486 | } |
| 1492 | 1487 | db_create_repository(g.argv[2]); |
| 1493 | 1488 | db_open_repository(g.argv[2]); |
| @@ -2153,11 +2148,11 @@ | ||
| 2153 | 2148 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2154 | 2149 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2155 | 2150 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2156 | 2151 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2157 | 2152 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2158 | - { "autosync-tries", 0, 0, 0, 0, "" }, | |
| 2153 | + { "autosync-tries", 0, 16, 0, 0, "1" }, | |
| 2159 | 2154 | { "binary-glob", 0, 40, 1, 0, "" }, |
| 2160 | 2155 | { "clearsign", 0, 0, 0, 0, "off" }, |
| 2161 | 2156 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \ |
| 2162 | 2157 | defined(__APPLE__) |
| 2163 | 2158 | { "case-sensitive", 0, 0, 0, 0, "off" }, |
| 2164 | 2159 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1465,29 +1465,24 @@ | |
| 1465 | ** |
| 1466 | ** Options: |
| 1467 | ** --template FILE copy settings from repository file |
| 1468 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1469 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1470 | ** (overrides --empty as well) |
| 1471 | ** --empty Do not create an initial empty checkin. |
| 1472 | ** |
| 1473 | ** See also: clone |
| 1474 | */ |
| 1475 | void create_repository_cmd(void){ |
| 1476 | char *zPassword; |
| 1477 | const char *zTemplate; /* Repository from which to copy settings */ |
| 1478 | const char *zDate; /* Date of the initial check-in */ |
| 1479 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1480 | char const *zCreateEmpty; /* --empty flag set? */ |
| 1481 | |
| 1482 | zTemplate = find_option("template",0,1); |
| 1483 | zDate = find_option("date-override",0,1); |
| 1484 | zDefaultUser = find_option("admin-user","A",1); |
| 1485 | zCreateEmpty = find_option("empty", 0, 0); |
| 1486 | if( !zDate && !zCreateEmpty ){ |
| 1487 | zDate = "now"; |
| 1488 | } |
| 1489 | if( g.argc!=3 ){ |
| 1490 | usage("REPOSITORY-NAME"); |
| 1491 | } |
| 1492 | db_create_repository(g.argv[2]); |
| 1493 | db_open_repository(g.argv[2]); |
| @@ -2153,11 +2148,11 @@ | |
| 2153 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2154 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2155 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2156 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2157 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2158 | { "autosync-tries", 0, 0, 0, 0, "" }, |
| 2159 | { "binary-glob", 0, 40, 1, 0, "" }, |
| 2160 | { "clearsign", 0, 0, 0, 0, "off" }, |
| 2161 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \ |
| 2162 | defined(__APPLE__) |
| 2163 | { "case-sensitive", 0, 0, 0, 0, "off" }, |
| 2164 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1465,29 +1465,24 @@ | |
| 1465 | ** |
| 1466 | ** Options: |
| 1467 | ** --template FILE copy settings from repository file |
| 1468 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1469 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1470 | ** (default: do not create an initial checkin) |
| 1471 | ** |
| 1472 | ** See also: clone |
| 1473 | */ |
| 1474 | void create_repository_cmd(void){ |
| 1475 | char *zPassword; |
| 1476 | const char *zTemplate; /* Repository from which to copy settings */ |
| 1477 | const char *zDate; /* Date of the initial check-in */ |
| 1478 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1479 | |
| 1480 | zTemplate = find_option("template",0,1); |
| 1481 | zDate = find_option("date-override",0,1); |
| 1482 | zDefaultUser = find_option("admin-user","A",1); |
| 1483 | find_option("empty", 0, 0); /* deprecated */ |
| 1484 | if( g.argc!=3 ){ |
| 1485 | usage("REPOSITORY-NAME"); |
| 1486 | } |
| 1487 | db_create_repository(g.argv[2]); |
| 1488 | db_open_repository(g.argv[2]); |
| @@ -2153,11 +2148,11 @@ | |
| 2148 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2149 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2150 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2151 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2152 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2153 | { "autosync-tries", 0, 16, 0, 0, "1" }, |
| 2154 | { "binary-glob", 0, 40, 1, 0, "" }, |
| 2155 | { "clearsign", 0, 0, 0, 0, "off" }, |
| 2156 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \ |
| 2157 | defined(__APPLE__) |
| 2158 | { "case-sensitive", 0, 0, 0, 0, "off" }, |
| 2159 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -406,11 +406,11 @@ | ||
| 406 | 406 | zLastBr = fossil_strdup(zBr); |
| 407 | 407 | } |
| 408 | 408 | n++; |
| 409 | 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | 410 | fossil_print("%6s ", zLineNo); |
| 411 | - z = mprintf("%s [%.10s] %s", zDate, zId, zCom); | |
| 411 | + z = mprintf("%s [%S] %s", zDate, zId, zCom); | |
| 412 | 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | 413 | fossil_free(z); |
| 414 | 414 | } |
| 415 | 415 | fossil_free(zLastBr); |
| 416 | 416 | db_finalize(&q); |
| 417 | 417 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zLastBr = fossil_strdup(zBr); |
| 407 | } |
| 408 | n++; |
| 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | fossil_print("%6s ", zLineNo); |
| 411 | z = mprintf("%s [%.10s] %s", zDate, zId, zCom); |
| 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | fossil_free(z); |
| 414 | } |
| 415 | fossil_free(zLastBr); |
| 416 | db_finalize(&q); |
| 417 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zLastBr = fossil_strdup(zBr); |
| 407 | } |
| 408 | n++; |
| 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | fossil_print("%6s ", zLineNo); |
| 411 | z = mprintf("%s [%S] %s", zDate, zId, zCom); |
| 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | fossil_free(z); |
| 414 | } |
| 415 | fossil_free(zLastBr); |
| 416 | db_finalize(&q); |
| 417 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -406,11 +406,11 @@ | ||
| 406 | 406 | zLastBr = fossil_strdup(zBr); |
| 407 | 407 | } |
| 408 | 408 | n++; |
| 409 | 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | 410 | fossil_print("%6s ", zLineNo); |
| 411 | - z = mprintf("%s [%.10s] %s", zDate, zId, zCom); | |
| 411 | + z = mprintf("%s [%S] %s", zDate, zId, zCom); | |
| 412 | 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | 413 | fossil_free(z); |
| 414 | 414 | } |
| 415 | 415 | fossil_free(zLastBr); |
| 416 | 416 | db_finalize(&q); |
| 417 | 417 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zLastBr = fossil_strdup(zBr); |
| 407 | } |
| 408 | n++; |
| 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | fossil_print("%6s ", zLineNo); |
| 411 | z = mprintf("%s [%.10s] %s", zDate, zId, zCom); |
| 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | fossil_free(z); |
| 414 | } |
| 415 | fossil_free(zLastBr); |
| 416 | db_finalize(&q); |
| 417 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -406,11 +406,11 @@ | |
| 406 | zLastBr = fossil_strdup(zBr); |
| 407 | } |
| 408 | n++; |
| 409 | sqlite3_snprintf(sizeof(zLineNo), zLineNo, "(%d)", n); |
| 410 | fossil_print("%6s ", zLineNo); |
| 411 | z = mprintf("%s [%S] %s", zDate, zId, zCom); |
| 412 | comment_print(z, 7, width, COMMENT_PRINT_DEFAULT); |
| 413 | fossil_free(z); |
| 414 | } |
| 415 | fossil_free(zLastBr); |
| 416 | db_finalize(&q); |
| 417 |
+5
-5
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2312,12 +2312,12 @@ | ||
| 2312 | 2312 | char *zLink = href("%R/finfo?name=%t&ci=%s",zFilename,zCI); |
| 2313 | 2313 | @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2> |
| 2314 | 2314 | @ <ol> |
| 2315 | 2315 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2316 | 2316 | @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate) |
| 2317 | - @ check-in %z(href("%R/info/%s",p->zMUuid))%.10s(p->zMUuid)</a> | |
| 2318 | - @ artifact %z(href("%R/artifact/%s",p->zFUuid))%.10s(p->zFUuid)</a> | |
| 2317 | + @ check-in %z(href("%R/info/%s",p->zMUuid))%S(p->zMUuid)</a> | |
| 2318 | + @ artifact %z(href("%R/artifact/%s",p->zFUuid))%S(p->zFUuid)</a> | |
| 2319 | 2319 | @ </span> |
| 2320 | 2320 | #if 0 |
| 2321 | 2321 | if( i>0 ){ |
| 2322 | 2322 | char *zLink = xhref("target='infowindow'", |
| 2323 | 2323 | "%R/fdiff?v1=%S&v2=%S&sbs=1", |
| @@ -2465,11 +2465,11 @@ | ||
| 2465 | 2465 | annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR); |
| 2466 | 2466 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2467 | 2467 | if( showLog ){ |
| 2468 | 2468 | struct AnnVers *p; |
| 2469 | 2469 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2470 | - fossil_print("version %3d: %s %.10s file %.10s\n", | |
| 2470 | + fossil_print("version %3d: %s %S file %S\n", | |
| 2471 | 2471 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2472 | 2472 | } |
| 2473 | 2473 | fossil_print("---------------------------------------------------\n"); |
| 2474 | 2474 | } |
| 2475 | 2475 | for(i=0; i<ann.nOrig; i++){ |
| @@ -2479,21 +2479,21 @@ | ||
| 2479 | 2479 | struct AnnVers *p; |
| 2480 | 2480 | if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1; |
| 2481 | 2481 | p = ann.aVers + iVers; |
| 2482 | 2482 | if( bBlame ){ |
| 2483 | 2483 | if( iVers>=0 ){ |
| 2484 | - fossil_print("%.10s %s %13.13s: %.*s\n", | |
| 2484 | + fossil_print("%S %s %13.13s: %.*s\n", | |
| 2485 | 2485 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, p->zUser, n, z); |
| 2486 | 2486 | }else{ |
| 2487 | 2487 | fossil_print("%35s %.*s\n", "", n, z); |
| 2488 | 2488 | } |
| 2489 | 2489 | }else{ |
| 2490 | 2490 | if( iVers>=0 ){ |
| 2491 | - fossil_print("%.10s %s %5d: %.*s\n", | |
| 2491 | + fossil_print("%S %s %5d: %.*s\n", | |
| 2492 | 2492 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, i+1, n, z); |
| 2493 | 2493 | }else{ |
| 2494 | 2494 | fossil_print("%21s %5d: %.*s\n", |
| 2495 | 2495 | "", i+1, n, z); |
| 2496 | 2496 | } |
| 2497 | 2497 | } |
| 2498 | 2498 | } |
| 2499 | 2499 | } |
| 2500 | 2500 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2312,12 +2312,12 @@ | |
| 2312 | char *zLink = href("%R/finfo?name=%t&ci=%s",zFilename,zCI); |
| 2313 | @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2> |
| 2314 | @ <ol> |
| 2315 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2316 | @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate) |
| 2317 | @ check-in %z(href("%R/info/%s",p->zMUuid))%.10s(p->zMUuid)</a> |
| 2318 | @ artifact %z(href("%R/artifact/%s",p->zFUuid))%.10s(p->zFUuid)</a> |
| 2319 | @ </span> |
| 2320 | #if 0 |
| 2321 | if( i>0 ){ |
| 2322 | char *zLink = xhref("target='infowindow'", |
| 2323 | "%R/fdiff?v1=%S&v2=%S&sbs=1", |
| @@ -2465,11 +2465,11 @@ | |
| 2465 | annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR); |
| 2466 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2467 | if( showLog ){ |
| 2468 | struct AnnVers *p; |
| 2469 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2470 | fossil_print("version %3d: %s %.10s file %.10s\n", |
| 2471 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2472 | } |
| 2473 | fossil_print("---------------------------------------------------\n"); |
| 2474 | } |
| 2475 | for(i=0; i<ann.nOrig; i++){ |
| @@ -2479,21 +2479,21 @@ | |
| 2479 | struct AnnVers *p; |
| 2480 | if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1; |
| 2481 | p = ann.aVers + iVers; |
| 2482 | if( bBlame ){ |
| 2483 | if( iVers>=0 ){ |
| 2484 | fossil_print("%.10s %s %13.13s: %.*s\n", |
| 2485 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, p->zUser, n, z); |
| 2486 | }else{ |
| 2487 | fossil_print("%35s %.*s\n", "", n, z); |
| 2488 | } |
| 2489 | }else{ |
| 2490 | if( iVers>=0 ){ |
| 2491 | fossil_print("%.10s %s %5d: %.*s\n", |
| 2492 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, i+1, n, z); |
| 2493 | }else{ |
| 2494 | fossil_print("%21s %5d: %.*s\n", |
| 2495 | "", i+1, n, z); |
| 2496 | } |
| 2497 | } |
| 2498 | } |
| 2499 | } |
| 2500 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2312,12 +2312,12 @@ | |
| 2312 | char *zLink = href("%R/finfo?name=%t&ci=%s",zFilename,zCI); |
| 2313 | @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2> |
| 2314 | @ <ol> |
| 2315 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2316 | @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate) |
| 2317 | @ check-in %z(href("%R/info/%s",p->zMUuid))%S(p->zMUuid)</a> |
| 2318 | @ artifact %z(href("%R/artifact/%s",p->zFUuid))%S(p->zFUuid)</a> |
| 2319 | @ </span> |
| 2320 | #if 0 |
| 2321 | if( i>0 ){ |
| 2322 | char *zLink = xhref("target='infowindow'", |
| 2323 | "%R/fdiff?v1=%S&v2=%S&sbs=1", |
| @@ -2465,11 +2465,11 @@ | |
| 2465 | annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR); |
| 2466 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2467 | if( showLog ){ |
| 2468 | struct AnnVers *p; |
| 2469 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2470 | fossil_print("version %3d: %s %S file %S\n", |
| 2471 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2472 | } |
| 2473 | fossil_print("---------------------------------------------------\n"); |
| 2474 | } |
| 2475 | for(i=0; i<ann.nOrig; i++){ |
| @@ -2479,21 +2479,21 @@ | |
| 2479 | struct AnnVers *p; |
| 2480 | if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1; |
| 2481 | p = ann.aVers + iVers; |
| 2482 | if( bBlame ){ |
| 2483 | if( iVers>=0 ){ |
| 2484 | fossil_print("%S %s %13.13s: %.*s\n", |
| 2485 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, p->zUser, n, z); |
| 2486 | }else{ |
| 2487 | fossil_print("%35s %.*s\n", "", n, z); |
| 2488 | } |
| 2489 | }else{ |
| 2490 | if( iVers>=0 ){ |
| 2491 | fossil_print("%S %s %5d: %.*s\n", |
| 2492 | fileVers ? p->zFUuid : p->zMUuid, p->zDate, i+1, n, z); |
| 2493 | }else{ |
| 2494 | fossil_print("%21s %5d: %.*s\n", |
| 2495 | "", i+1, n, z); |
| 2496 | } |
| 2497 | } |
| 2498 | } |
| 2499 | } |
| 2500 |
+2
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -200,11 +200,11 @@ | ||
| 200 | 200 | char *zOut; |
| 201 | 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | 202 | if( iBrief ){ |
| 203 | 203 | fossil_print("%s ", zDate); |
| 204 | 204 | zOut = sqlite3_mprintf( |
| 205 | - "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", | |
| 205 | + "[%S] %s (user: %s, artifact: [%S], branch: %s)", | |
| 206 | 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | 208 | sqlite3_free(zOut); |
| 209 | 209 | }else{ |
| 210 | 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | ||
| 382 | 382 | if( baseCheckin ){ |
| 383 | 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | - blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); | |
| 387 | + blob_appendf(&title, " from check-in %z%S</a>", zLink, zUuid); | |
| 388 | 388 | fossil_free(zUuid); |
| 389 | 389 | }else{ |
| 390 | 390 | blob_appendf(&title, "History of files named "); |
| 391 | 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | 392 | } |
| 393 | 393 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | char *zOut; |
| 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | if( iBrief ){ |
| 203 | fossil_print("%s ", zDate); |
| 204 | zOut = sqlite3_mprintf( |
| 205 | "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", |
| 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | sqlite3_free(zOut); |
| 209 | }else{ |
| 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | |
| 382 | if( baseCheckin ){ |
| 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 388 | fossil_free(zUuid); |
| 389 | }else{ |
| 390 | blob_appendf(&title, "History of files named "); |
| 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | } |
| 393 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | char *zOut; |
| 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | if( iBrief ){ |
| 203 | fossil_print("%s ", zDate); |
| 204 | zOut = sqlite3_mprintf( |
| 205 | "[%S] %s (user: %s, artifact: [%S], branch: %s)", |
| 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | sqlite3_free(zOut); |
| 209 | }else{ |
| 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | |
| 382 | if( baseCheckin ){ |
| 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | blob_appendf(&title, " from check-in %z%S</a>", zLink, zUuid); |
| 388 | fossil_free(zUuid); |
| 389 | }else{ |
| 390 | blob_appendf(&title, "History of files named "); |
| 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | } |
| 393 |
+2
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -200,11 +200,11 @@ | ||
| 200 | 200 | char *zOut; |
| 201 | 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | 202 | if( iBrief ){ |
| 203 | 203 | fossil_print("%s ", zDate); |
| 204 | 204 | zOut = sqlite3_mprintf( |
| 205 | - "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", | |
| 205 | + "[%S] %s (user: %s, artifact: [%S], branch: %s)", | |
| 206 | 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | 208 | sqlite3_free(zOut); |
| 209 | 209 | }else{ |
| 210 | 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | ||
| 382 | 382 | if( baseCheckin ){ |
| 383 | 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | - blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); | |
| 387 | + blob_appendf(&title, " from check-in %z%S</a>", zLink, zUuid); | |
| 388 | 388 | fossil_free(zUuid); |
| 389 | 389 | }else{ |
| 390 | 390 | blob_appendf(&title, "History of files named "); |
| 391 | 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | 392 | } |
| 393 | 393 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | char *zOut; |
| 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | if( iBrief ){ |
| 203 | fossil_print("%s ", zDate); |
| 204 | zOut = sqlite3_mprintf( |
| 205 | "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", |
| 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | sqlite3_free(zOut); |
| 209 | }else{ |
| 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | |
| 382 | if( baseCheckin ){ |
| 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 388 | fossil_free(zUuid); |
| 389 | }else{ |
| 390 | blob_appendf(&title, "History of files named "); |
| 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | } |
| 393 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -200,11 +200,11 @@ | |
| 200 | char *zOut; |
| 201 | if( zBr==0 ) zBr = "trunk"; |
| 202 | if( iBrief ){ |
| 203 | fossil_print("%s ", zDate); |
| 204 | zOut = sqlite3_mprintf( |
| 205 | "[%S] %s (user: %s, artifact: [%S], branch: %s)", |
| 206 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 207 | comment_print(zOut, 11, iWidth, COMMENT_PRINT_DEFAULT); |
| 208 | sqlite3_free(zOut); |
| 209 | }else{ |
| 210 | blob_reset(&line); |
| @@ -382,11 +382,11 @@ | |
| 382 | if( baseCheckin ){ |
| 383 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 384 | char *zLink = href("%R/info/%s", zUuid); |
| 385 | blob_appendf(&title, "Ancestors of file "); |
| 386 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 387 | blob_appendf(&title, " from check-in %z%S</a>", zLink, zUuid); |
| 388 | fossil_free(zUuid); |
| 389 | }else{ |
| 390 | blob_appendf(&title, "History of files named "); |
| 391 | hyperlinked_path(zFilename, &title, 0, "tree", ""); |
| 392 | } |
| 393 |
+2
-2
| --- src/http_socket.c | ||
| +++ src/http_socket.c | ||
| @@ -20,11 +20,11 @@ | ||
| 20 | 20 | ** |
| 21 | 21 | ** This file implements a singleton. A single client socket may be active |
| 22 | 22 | ** at a time. State information is stored in static variables. The identity |
| 23 | 23 | ** of the server is held in global variables that are set by url_parse(). |
| 24 | 24 | ** |
| 25 | -** Low-level sockets are abstracted out into this module because they | |
| 25 | +** Low-level sockets are abstracted out into this module because they | |
| 26 | 26 | ** are handled different on Unix and windows. |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | 29 | #include "config.h" |
| 30 | 30 | #include "http_socket.h" |
| @@ -63,11 +63,11 @@ | ||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /* |
| 66 | 66 | ** Set the socket error message. |
| 67 | 67 | */ |
| 68 | -void socket_set_errmsg(char *zFormat, ...){ | |
| 68 | +void socket_set_errmsg(const char *zFormat, ...){ | |
| 69 | 69 | va_list ap; |
| 70 | 70 | socket_clear_errmsg(); |
| 71 | 71 | va_start(ap, zFormat); |
| 72 | 72 | socketErrMsg = vmprintf(zFormat, ap); |
| 73 | 73 | va_end(ap); |
| 74 | 74 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -20,11 +20,11 @@ | |
| 20 | ** |
| 21 | ** This file implements a singleton. A single client socket may be active |
| 22 | ** at a time. State information is stored in static variables. The identity |
| 23 | ** of the server is held in global variables that are set by url_parse(). |
| 24 | ** |
| 25 | ** Low-level sockets are abstracted out into this module because they |
| 26 | ** are handled different on Unix and windows. |
| 27 | */ |
| 28 | |
| 29 | #include "config.h" |
| 30 | #include "http_socket.h" |
| @@ -63,11 +63,11 @@ | |
| 63 | } |
| 64 | |
| 65 | /* |
| 66 | ** Set the socket error message. |
| 67 | */ |
| 68 | void socket_set_errmsg(char *zFormat, ...){ |
| 69 | va_list ap; |
| 70 | socket_clear_errmsg(); |
| 71 | va_start(ap, zFormat); |
| 72 | socketErrMsg = vmprintf(zFormat, ap); |
| 73 | va_end(ap); |
| 74 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -20,11 +20,11 @@ | |
| 20 | ** |
| 21 | ** This file implements a singleton. A single client socket may be active |
| 22 | ** at a time. State information is stored in static variables. The identity |
| 23 | ** of the server is held in global variables that are set by url_parse(). |
| 24 | ** |
| 25 | ** Low-level sockets are abstracted out into this module because they |
| 26 | ** are handled different on Unix and windows. |
| 27 | */ |
| 28 | |
| 29 | #include "config.h" |
| 30 | #include "http_socket.h" |
| @@ -63,11 +63,11 @@ | |
| 63 | } |
| 64 | |
| 65 | /* |
| 66 | ** Set the socket error message. |
| 67 | */ |
| 68 | void socket_set_errmsg(const char *zFormat, ...){ |
| 69 | va_list ap; |
| 70 | socket_clear_errmsg(); |
| 71 | va_start(ap, zFormat); |
| 72 | socketErrMsg = vmprintf(zFormat, ap); |
| 73 | va_end(ap); |
| 74 |
+16
-16
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /* |
| 61 | 61 | ** Set the SSL error message. |
| 62 | 62 | */ |
| 63 | -void ssl_set_errmsg(char *zFormat, ...){ | |
| 63 | +void ssl_set_errmsg(const char *zFormat, ...){ | |
| 64 | 64 | va_list ap; |
| 65 | 65 | ssl_clear_errmsg(); |
| 66 | 66 | va_start(ap, zFormat); |
| 67 | 67 | sslErrMsg = vmprintf(zFormat, ap); |
| 68 | 68 | va_end(ap); |
| @@ -82,30 +82,30 @@ | ||
| 82 | 82 | static int ssl_client_cert_callback(SSL *ssl, X509 **x509, EVP_PKEY **pkey){ |
| 83 | 83 | fossil_warning("The remote server requested a client certificate for " |
| 84 | 84 | "authentication. Specify the pathname to a file containing the PEM " |
| 85 | 85 | "encoded certificate and private key with the --ssl-identity option " |
| 86 | 86 | "or the ssl-identity setting."); |
| 87 | - return 0; /* no cert available */ | |
| 87 | + return 0; /* no cert available */ | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /* |
| 91 | 91 | ** Call this routine once before any other use of the SSL interface. |
| 92 | 92 | ** This routine does initial configuration of the SSL module. |
| 93 | 93 | */ |
| 94 | 94 | void ssl_global_init(void){ |
| 95 | 95 | const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0; |
| 96 | 96 | const char *identityFile; |
| 97 | - | |
| 97 | + | |
| 98 | 98 | if( sslIsInit==0 ){ |
| 99 | 99 | SSL_library_init(); |
| 100 | 100 | SSL_load_error_strings(); |
| 101 | 101 | ERR_load_BIO_strings(); |
| 102 | - OpenSSL_add_all_algorithms(); | |
| 102 | + OpenSSL_add_all_algorithms(); | |
| 103 | 103 | sslCtx = SSL_CTX_new(SSLv23_client_method()); |
| 104 | 104 | /* Disable SSLv2 */ |
| 105 | 105 | SSL_CTX_set_options(sslCtx, SSL_OP_NO_SSLv2); |
| 106 | - | |
| 106 | + | |
| 107 | 107 | /* Set up acceptable CA root certificates */ |
| 108 | 108 | zCaSetting = db_get("ssl-ca-location", 0); |
| 109 | 109 | if( zCaSetting==0 || zCaSetting[0]=='\0' ){ |
| 110 | 110 | /* CA location not specified, use platform's default certificate store */ |
| 111 | 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| @@ -129,11 +129,11 @@ | ||
| 129 | 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | 130 | fossil_fatal("Failed to use CA root certificates from " |
| 131 | 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | - | |
| 134 | + | |
| 135 | 135 | /* Load client SSL identity, preferring the filename specified on the |
| 136 | 136 | ** command line */ |
| 137 | 137 | if( g.zSSLIdentity!=0 ){ |
| 138 | 138 | identityFile = g.zSSLIdentity; |
| 139 | 139 | }else{ |
| @@ -164,11 +164,11 @@ | ||
| 164 | 164 | sslIsInit = 0; |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /* |
| 169 | -** Close the currently open SSL connection. If no connection is open, | |
| 169 | +** Close the currently open SSL connection. If no connection is open, | |
| 170 | 170 | ** this routine is a no-op. |
| 171 | 171 | */ |
| 172 | 172 | void ssl_close(void){ |
| 173 | 173 | if( iBio!=NULL ){ |
| 174 | 174 | (void)BIO_reset(iBio); |
| @@ -276,11 +276,11 @@ | ||
| 276 | 276 | BIO_push(iBio, sBio); |
| 277 | 277 | }else{ |
| 278 | 278 | iBio = BIO_new_ssl_connect(sslCtx); |
| 279 | 279 | } |
| 280 | 280 | if( iBio==NULL ) { |
| 281 | - ssl_set_errmsg("SSL: cannot open SSL (%s)", | |
| 281 | + ssl_set_errmsg("SSL: cannot open SSL (%s)", | |
| 282 | 282 | ERR_reason_error_string(ERR_get_error())); |
| 283 | 283 | return 1; |
| 284 | 284 | } |
| 285 | 285 | BIO_get_ssl(iBio, &ssl); |
| 286 | 286 | |
| @@ -295,19 +295,19 @@ | ||
| 295 | 295 | |
| 296 | 296 | if( !pUrlData->useProxy ){ |
| 297 | 297 | BIO_set_conn_hostname(iBio, pUrlData->name); |
| 298 | 298 | BIO_set_conn_int_port(iBio, &pUrlData->port); |
| 299 | 299 | if( BIO_do_connect(iBio)<=0 ){ |
| 300 | - ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", | |
| 300 | + ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", | |
| 301 | 301 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 302 | 302 | ssl_close(); |
| 303 | 303 | return 1; |
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | - | |
| 306 | + | |
| 307 | 307 | if( BIO_do_handshake(iBio)<=0 ) { |
| 308 | - ssl_set_errmsg("Error establishing SSL connection %s:%d (%s)", | |
| 308 | + ssl_set_errmsg("Error establishing SSL connection %s:%d (%s)", | |
| 309 | 309 | pUrlData->useProxy?pUrlData->hostname:pUrlData->name, |
| 310 | 310 | pUrlData->useProxy?pUrlData->proxyOrigPort:pUrlData->port, |
| 311 | 311 | ERR_reason_error_string(ERR_get_error())); |
| 312 | 312 | ssl_close(); |
| 313 | 313 | return 1; |
| @@ -321,17 +321,17 @@ | ||
| 321 | 321 | return 1; |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | if( trusted<=0 && (e = SSL_get_verify_result(ssl)) != X509_V_OK ){ |
| 325 | 325 | char *desc, *prompt; |
| 326 | - char *warning = ""; | |
| 326 | + const char *warning = ""; | |
| 327 | 327 | Blob ans; |
| 328 | 328 | char cReply; |
| 329 | 329 | BIO *mem; |
| 330 | 330 | unsigned char md[32]; |
| 331 | 331 | unsigned int mdLength = 31; |
| 332 | - | |
| 332 | + | |
| 333 | 333 | mem = BIO_new(BIO_s_mem()); |
| 334 | 334 | X509_NAME_print_ex(mem, X509_get_subject_name(cert), 2, XN_FLAG_MULTILINE); |
| 335 | 335 | BIO_puts(mem, "\n\nIssued By:\n\n"); |
| 336 | 336 | X509_NAME_print_ex(mem, X509_get_issuer_name(cert), 2, XN_FLAG_MULTILINE); |
| 337 | 337 | BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n "); |
| @@ -341,11 +341,11 @@ | ||
| 341 | 341 | BIO_printf(mem, " %02x", md[j]); |
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | BIO_write(mem, "", 1); /* nul-terminate mem buffer */ |
| 345 | 345 | BIO_get_mem_data(mem, &desc); |
| 346 | - | |
| 346 | + | |
| 347 | 347 | if( hasSavedCertificate ){ |
| 348 | 348 | warning = "WARNING: Certificate doesn't match the " |
| 349 | 349 | "saved certificate for this host!"; |
| 350 | 350 | } |
| 351 | 351 | prompt = mprintf("\nSSL verification failed: %s\n" |
| @@ -413,11 +413,11 @@ | ||
| 413 | 413 | db_set(zHost, zCert, 1); |
| 414 | 414 | free(zHost); |
| 415 | 415 | zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); |
| 416 | 416 | db_set_int(zHost, trusted, 1); |
| 417 | 417 | free(zHost); |
| 418 | - BIO_free(mem); | |
| 418 | + BIO_free(mem); | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /* |
| 422 | 422 | ** Get certificate for pUrlData->urlName from global config. |
| 423 | 423 | ** Return NULL if no certificate found. |
| @@ -443,11 +443,11 @@ | ||
| 443 | 443 | |
| 444 | 444 | mem = BIO_new(BIO_s_mem()); |
| 445 | 445 | BIO_puts(mem, zCert); |
| 446 | 446 | cert = PEM_read_bio_X509(mem, NULL, 0, NULL); |
| 447 | 447 | free(zCert); |
| 448 | - BIO_free(mem); | |
| 448 | + BIO_free(mem); | |
| 449 | 449 | return cert; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | /* |
| 453 | 453 | ** Send content out over the SSL connection. |
| 454 | 454 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | ** Set the SSL error message. |
| 62 | */ |
| 63 | void ssl_set_errmsg(char *zFormat, ...){ |
| 64 | va_list ap; |
| 65 | ssl_clear_errmsg(); |
| 66 | va_start(ap, zFormat); |
| 67 | sslErrMsg = vmprintf(zFormat, ap); |
| 68 | va_end(ap); |
| @@ -82,30 +82,30 @@ | |
| 82 | static int ssl_client_cert_callback(SSL *ssl, X509 **x509, EVP_PKEY **pkey){ |
| 83 | fossil_warning("The remote server requested a client certificate for " |
| 84 | "authentication. Specify the pathname to a file containing the PEM " |
| 85 | "encoded certificate and private key with the --ssl-identity option " |
| 86 | "or the ssl-identity setting."); |
| 87 | return 0; /* no cert available */ |
| 88 | } |
| 89 | |
| 90 | /* |
| 91 | ** Call this routine once before any other use of the SSL interface. |
| 92 | ** This routine does initial configuration of the SSL module. |
| 93 | */ |
| 94 | void ssl_global_init(void){ |
| 95 | const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0; |
| 96 | const char *identityFile; |
| 97 | |
| 98 | if( sslIsInit==0 ){ |
| 99 | SSL_library_init(); |
| 100 | SSL_load_error_strings(); |
| 101 | ERR_load_BIO_strings(); |
| 102 | OpenSSL_add_all_algorithms(); |
| 103 | sslCtx = SSL_CTX_new(SSLv23_client_method()); |
| 104 | /* Disable SSLv2 */ |
| 105 | SSL_CTX_set_options(sslCtx, SSL_OP_NO_SSLv2); |
| 106 | |
| 107 | /* Set up acceptable CA root certificates */ |
| 108 | zCaSetting = db_get("ssl-ca-location", 0); |
| 109 | if( zCaSetting==0 || zCaSetting[0]=='\0' ){ |
| 110 | /* CA location not specified, use platform's default certificate store */ |
| 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| @@ -129,11 +129,11 @@ | |
| 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | fossil_fatal("Failed to use CA root certificates from " |
| 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /* Load client SSL identity, preferring the filename specified on the |
| 136 | ** command line */ |
| 137 | if( g.zSSLIdentity!=0 ){ |
| 138 | identityFile = g.zSSLIdentity; |
| 139 | }else{ |
| @@ -164,11 +164,11 @@ | |
| 164 | sslIsInit = 0; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | ** Close the currently open SSL connection. If no connection is open, |
| 170 | ** this routine is a no-op. |
| 171 | */ |
| 172 | void ssl_close(void){ |
| 173 | if( iBio!=NULL ){ |
| 174 | (void)BIO_reset(iBio); |
| @@ -276,11 +276,11 @@ | |
| 276 | BIO_push(iBio, sBio); |
| 277 | }else{ |
| 278 | iBio = BIO_new_ssl_connect(sslCtx); |
| 279 | } |
| 280 | if( iBio==NULL ) { |
| 281 | ssl_set_errmsg("SSL: cannot open SSL (%s)", |
| 282 | ERR_reason_error_string(ERR_get_error())); |
| 283 | return 1; |
| 284 | } |
| 285 | BIO_get_ssl(iBio, &ssl); |
| 286 | |
| @@ -295,19 +295,19 @@ | |
| 295 | |
| 296 | if( !pUrlData->useProxy ){ |
| 297 | BIO_set_conn_hostname(iBio, pUrlData->name); |
| 298 | BIO_set_conn_int_port(iBio, &pUrlData->port); |
| 299 | if( BIO_do_connect(iBio)<=0 ){ |
| 300 | ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", |
| 301 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 302 | ssl_close(); |
| 303 | return 1; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | if( BIO_do_handshake(iBio)<=0 ) { |
| 308 | ssl_set_errmsg("Error establishing SSL connection %s:%d (%s)", |
| 309 | pUrlData->useProxy?pUrlData->hostname:pUrlData->name, |
| 310 | pUrlData->useProxy?pUrlData->proxyOrigPort:pUrlData->port, |
| 311 | ERR_reason_error_string(ERR_get_error())); |
| 312 | ssl_close(); |
| 313 | return 1; |
| @@ -321,17 +321,17 @@ | |
| 321 | return 1; |
| 322 | } |
| 323 | |
| 324 | if( trusted<=0 && (e = SSL_get_verify_result(ssl)) != X509_V_OK ){ |
| 325 | char *desc, *prompt; |
| 326 | char *warning = ""; |
| 327 | Blob ans; |
| 328 | char cReply; |
| 329 | BIO *mem; |
| 330 | unsigned char md[32]; |
| 331 | unsigned int mdLength = 31; |
| 332 | |
| 333 | mem = BIO_new(BIO_s_mem()); |
| 334 | X509_NAME_print_ex(mem, X509_get_subject_name(cert), 2, XN_FLAG_MULTILINE); |
| 335 | BIO_puts(mem, "\n\nIssued By:\n\n"); |
| 336 | X509_NAME_print_ex(mem, X509_get_issuer_name(cert), 2, XN_FLAG_MULTILINE); |
| 337 | BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n "); |
| @@ -341,11 +341,11 @@ | |
| 341 | BIO_printf(mem, " %02x", md[j]); |
| 342 | } |
| 343 | } |
| 344 | BIO_write(mem, "", 1); /* nul-terminate mem buffer */ |
| 345 | BIO_get_mem_data(mem, &desc); |
| 346 | |
| 347 | if( hasSavedCertificate ){ |
| 348 | warning = "WARNING: Certificate doesn't match the " |
| 349 | "saved certificate for this host!"; |
| 350 | } |
| 351 | prompt = mprintf("\nSSL verification failed: %s\n" |
| @@ -413,11 +413,11 @@ | |
| 413 | db_set(zHost, zCert, 1); |
| 414 | free(zHost); |
| 415 | zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); |
| 416 | db_set_int(zHost, trusted, 1); |
| 417 | free(zHost); |
| 418 | BIO_free(mem); |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | ** Get certificate for pUrlData->urlName from global config. |
| 423 | ** Return NULL if no certificate found. |
| @@ -443,11 +443,11 @@ | |
| 443 | |
| 444 | mem = BIO_new(BIO_s_mem()); |
| 445 | BIO_puts(mem, zCert); |
| 446 | cert = PEM_read_bio_X509(mem, NULL, 0, NULL); |
| 447 | free(zCert); |
| 448 | BIO_free(mem); |
| 449 | return cert; |
| 450 | } |
| 451 | |
| 452 | /* |
| 453 | ** Send content out over the SSL connection. |
| 454 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -58,11 +58,11 @@ | |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | ** Set the SSL error message. |
| 62 | */ |
| 63 | void ssl_set_errmsg(const char *zFormat, ...){ |
| 64 | va_list ap; |
| 65 | ssl_clear_errmsg(); |
| 66 | va_start(ap, zFormat); |
| 67 | sslErrMsg = vmprintf(zFormat, ap); |
| 68 | va_end(ap); |
| @@ -82,30 +82,30 @@ | |
| 82 | static int ssl_client_cert_callback(SSL *ssl, X509 **x509, EVP_PKEY **pkey){ |
| 83 | fossil_warning("The remote server requested a client certificate for " |
| 84 | "authentication. Specify the pathname to a file containing the PEM " |
| 85 | "encoded certificate and private key with the --ssl-identity option " |
| 86 | "or the ssl-identity setting."); |
| 87 | return 0; /* no cert available */ |
| 88 | } |
| 89 | |
| 90 | /* |
| 91 | ** Call this routine once before any other use of the SSL interface. |
| 92 | ** This routine does initial configuration of the SSL module. |
| 93 | */ |
| 94 | void ssl_global_init(void){ |
| 95 | const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0; |
| 96 | const char *identityFile; |
| 97 | |
| 98 | if( sslIsInit==0 ){ |
| 99 | SSL_library_init(); |
| 100 | SSL_load_error_strings(); |
| 101 | ERR_load_BIO_strings(); |
| 102 | OpenSSL_add_all_algorithms(); |
| 103 | sslCtx = SSL_CTX_new(SSLv23_client_method()); |
| 104 | /* Disable SSLv2 */ |
| 105 | SSL_CTX_set_options(sslCtx, SSL_OP_NO_SSLv2); |
| 106 | |
| 107 | /* Set up acceptable CA root certificates */ |
| 108 | zCaSetting = db_get("ssl-ca-location", 0); |
| 109 | if( zCaSetting==0 || zCaSetting[0]=='\0' ){ |
| 110 | /* CA location not specified, use platform's default certificate store */ |
| 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| @@ -129,11 +129,11 @@ | |
| 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | fossil_fatal("Failed to use CA root certificates from " |
| 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /* Load client SSL identity, preferring the filename specified on the |
| 136 | ** command line */ |
| 137 | if( g.zSSLIdentity!=0 ){ |
| 138 | identityFile = g.zSSLIdentity; |
| 139 | }else{ |
| @@ -164,11 +164,11 @@ | |
| 164 | sslIsInit = 0; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /* |
| 169 | ** Close the currently open SSL connection. If no connection is open, |
| 170 | ** this routine is a no-op. |
| 171 | */ |
| 172 | void ssl_close(void){ |
| 173 | if( iBio!=NULL ){ |
| 174 | (void)BIO_reset(iBio); |
| @@ -276,11 +276,11 @@ | |
| 276 | BIO_push(iBio, sBio); |
| 277 | }else{ |
| 278 | iBio = BIO_new_ssl_connect(sslCtx); |
| 279 | } |
| 280 | if( iBio==NULL ) { |
| 281 | ssl_set_errmsg("SSL: cannot open SSL (%s)", |
| 282 | ERR_reason_error_string(ERR_get_error())); |
| 283 | return 1; |
| 284 | } |
| 285 | BIO_get_ssl(iBio, &ssl); |
| 286 | |
| @@ -295,19 +295,19 @@ | |
| 295 | |
| 296 | if( !pUrlData->useProxy ){ |
| 297 | BIO_set_conn_hostname(iBio, pUrlData->name); |
| 298 | BIO_set_conn_int_port(iBio, &pUrlData->port); |
| 299 | if( BIO_do_connect(iBio)<=0 ){ |
| 300 | ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", |
| 301 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 302 | ssl_close(); |
| 303 | return 1; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | if( BIO_do_handshake(iBio)<=0 ) { |
| 308 | ssl_set_errmsg("Error establishing SSL connection %s:%d (%s)", |
| 309 | pUrlData->useProxy?pUrlData->hostname:pUrlData->name, |
| 310 | pUrlData->useProxy?pUrlData->proxyOrigPort:pUrlData->port, |
| 311 | ERR_reason_error_string(ERR_get_error())); |
| 312 | ssl_close(); |
| 313 | return 1; |
| @@ -321,17 +321,17 @@ | |
| 321 | return 1; |
| 322 | } |
| 323 | |
| 324 | if( trusted<=0 && (e = SSL_get_verify_result(ssl)) != X509_V_OK ){ |
| 325 | char *desc, *prompt; |
| 326 | const char *warning = ""; |
| 327 | Blob ans; |
| 328 | char cReply; |
| 329 | BIO *mem; |
| 330 | unsigned char md[32]; |
| 331 | unsigned int mdLength = 31; |
| 332 | |
| 333 | mem = BIO_new(BIO_s_mem()); |
| 334 | X509_NAME_print_ex(mem, X509_get_subject_name(cert), 2, XN_FLAG_MULTILINE); |
| 335 | BIO_puts(mem, "\n\nIssued By:\n\n"); |
| 336 | X509_NAME_print_ex(mem, X509_get_issuer_name(cert), 2, XN_FLAG_MULTILINE); |
| 337 | BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n "); |
| @@ -341,11 +341,11 @@ | |
| 341 | BIO_printf(mem, " %02x", md[j]); |
| 342 | } |
| 343 | } |
| 344 | BIO_write(mem, "", 1); /* nul-terminate mem buffer */ |
| 345 | BIO_get_mem_data(mem, &desc); |
| 346 | |
| 347 | if( hasSavedCertificate ){ |
| 348 | warning = "WARNING: Certificate doesn't match the " |
| 349 | "saved certificate for this host!"; |
| 350 | } |
| 351 | prompt = mprintf("\nSSL verification failed: %s\n" |
| @@ -413,11 +413,11 @@ | |
| 413 | db_set(zHost, zCert, 1); |
| 414 | free(zHost); |
| 415 | zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); |
| 416 | db_set_int(zHost, trusted, 1); |
| 417 | free(zHost); |
| 418 | BIO_free(mem); |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | ** Get certificate for pUrlData->urlName from global config. |
| 423 | ** Return NULL if no certificate found. |
| @@ -443,11 +443,11 @@ | |
| 443 | |
| 444 | mem = BIO_new(BIO_s_mem()); |
| 445 | BIO_puts(mem, zCert); |
| 446 | cert = PEM_read_bio_X509(mem, NULL, 0, NULL); |
| 447 | free(zCert); |
| 448 | BIO_free(mem); |
| 449 | return cert; |
| 450 | } |
| 451 | |
| 452 | /* |
| 453 | ** Send content out over the SSL connection. |
| 454 |
+3
-3
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -77,12 +77,12 @@ | ||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /* |
| 80 | 80 | ** Default SSH command |
| 81 | 81 | */ |
| 82 | -#ifdef __MINGW32__ | |
| 83 | -static char zDefaultSshCmd[] = "ssh -T"; | |
| 82 | +#ifdef _WIN32 | |
| 83 | +static char zDefaultSshCmd[] = "plink -ssh -T"; | |
| 84 | 84 | #else |
| 85 | 85 | static char zDefaultSshCmd[] = "ssh -e none -T"; |
| 86 | 86 | #endif |
| 87 | 87 | |
| 88 | 88 | /* |
| @@ -99,11 +99,11 @@ | ||
| 99 | 99 | |
| 100 | 100 | socket_ssh_resolve_addr(pUrlData); |
| 101 | 101 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 102 | 102 | blob_init(&zCmd, zSsh, -1); |
| 103 | 103 | if( pUrlData->port!=pUrlData->dfltPort && pUrlData->port ){ |
| 104 | -#ifdef __MINGW32__ | |
| 104 | +#ifdef _WIN32 | |
| 105 | 105 | blob_appendf(&zCmd, " -P %d", pUrlData->port); |
| 106 | 106 | #else |
| 107 | 107 | blob_appendf(&zCmd, " -p %d", pUrlData->port); |
| 108 | 108 | #endif |
| 109 | 109 | } |
| 110 | 110 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -77,12 +77,12 @@ | |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | ** Default SSH command |
| 81 | */ |
| 82 | #ifdef __MINGW32__ |
| 83 | static char zDefaultSshCmd[] = "ssh -T"; |
| 84 | #else |
| 85 | static char zDefaultSshCmd[] = "ssh -e none -T"; |
| 86 | #endif |
| 87 | |
| 88 | /* |
| @@ -99,11 +99,11 @@ | |
| 99 | |
| 100 | socket_ssh_resolve_addr(pUrlData); |
| 101 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 102 | blob_init(&zCmd, zSsh, -1); |
| 103 | if( pUrlData->port!=pUrlData->dfltPort && pUrlData->port ){ |
| 104 | #ifdef __MINGW32__ |
| 105 | blob_appendf(&zCmd, " -P %d", pUrlData->port); |
| 106 | #else |
| 107 | blob_appendf(&zCmd, " -p %d", pUrlData->port); |
| 108 | #endif |
| 109 | } |
| 110 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -77,12 +77,12 @@ | |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | ** Default SSH command |
| 81 | */ |
| 82 | #ifdef _WIN32 |
| 83 | static char zDefaultSshCmd[] = "plink -ssh -T"; |
| 84 | #else |
| 85 | static char zDefaultSshCmd[] = "ssh -e none -T"; |
| 86 | #endif |
| 87 | |
| 88 | /* |
| @@ -99,11 +99,11 @@ | |
| 99 | |
| 100 | socket_ssh_resolve_addr(pUrlData); |
| 101 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 102 | blob_init(&zCmd, zSsh, -1); |
| 103 | if( pUrlData->port!=pUrlData->dfltPort && pUrlData->port ){ |
| 104 | #ifdef _WIN32 |
| 105 | blob_appendf(&zCmd, " -P %d", pUrlData->port); |
| 106 | #else |
| 107 | blob_appendf(&zCmd, " -p %d", pUrlData->port); |
| 108 | #endif |
| 109 | } |
| 110 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -531,11 +531,11 @@ | ||
| 531 | 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | 532 | ); |
| 533 | 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | - char *zTitle = mprintf("Check-in [%.10s]", zUuid); | |
| 536 | + char *zTitle = mprintf("Check-in [%S]", zUuid); | |
| 537 | 537 | char *zEUser, *zEComment; |
| 538 | 538 | const char *zUser; |
| 539 | 539 | const char *zComment; |
| 540 | 540 | const char *zDate; |
| 541 | 541 | const char *zOrigDate; |
| 542 | 542 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -531,11 +531,11 @@ | |
| 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | ); |
| 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | char *zTitle = mprintf("Check-in [%.10s]", zUuid); |
| 537 | char *zEUser, *zEComment; |
| 538 | const char *zUser; |
| 539 | const char *zComment; |
| 540 | const char *zDate; |
| 541 | const char *zOrigDate; |
| 542 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -531,11 +531,11 @@ | |
| 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | ); |
| 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | char *zTitle = mprintf("Check-in [%S]", zUuid); |
| 537 | char *zEUser, *zEComment; |
| 538 | const char *zUser; |
| 539 | const char *zComment; |
| 540 | const char *zDate; |
| 541 | const char *zOrigDate; |
| 542 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -531,11 +531,11 @@ | ||
| 531 | 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | 532 | ); |
| 533 | 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | - char *zTitle = mprintf("Check-in [%.10s]", zUuid); | |
| 536 | + char *zTitle = mprintf("Check-in [%S]", zUuid); | |
| 537 | 537 | char *zEUser, *zEComment; |
| 538 | 538 | const char *zUser; |
| 539 | 539 | const char *zComment; |
| 540 | 540 | const char *zDate; |
| 541 | 541 | const char *zOrigDate; |
| 542 | 542 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -531,11 +531,11 @@ | |
| 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | ); |
| 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | char *zTitle = mprintf("Check-in [%.10s]", zUuid); |
| 537 | char *zEUser, *zEComment; |
| 538 | const char *zUser; |
| 539 | const char *zComment; |
| 540 | const char *zDate; |
| 541 | const char *zOrigDate; |
| 542 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -531,11 +531,11 @@ | |
| 531 | timeline_utc(), timeline_utc(), rid, rid |
| 532 | ); |
| 533 | sideBySide = !is_false(PD("sbs","1")); |
| 534 | if( db_step(&q1)==SQLITE_ROW ){ |
| 535 | const char *zUuid = db_column_text(&q1, 0); |
| 536 | char *zTitle = mprintf("Check-in [%S]", zUuid); |
| 537 | char *zEUser, *zEComment; |
| 538 | const char *zUser; |
| 539 | const char *zComment; |
| 540 | const char *zDate; |
| 541 | const char *zOrigDate; |
| 542 |
+7
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -298,15 +298,16 @@ | ||
| 298 | 298 | */ |
| 299 | 299 | static int name_search( |
| 300 | 300 | const char *zName, /* The name we are looking for */ |
| 301 | 301 | const NameMap *aMap, /* Search in this array */ |
| 302 | 302 | int nMap, /* Number of slots in aMap[] */ |
| 303 | + int iBegin, /* Lower bound on the array search */ | |
| 303 | 304 | int *pIndex /* OUT: The index in aMap[] of the match */ |
| 304 | 305 | ){ |
| 305 | 306 | int upr, lwr, cnt, m, i; |
| 306 | 307 | int n = strlen(zName); |
| 307 | - lwr = 0; | |
| 308 | + lwr = iBegin; | |
| 308 | 309 | upr = nMap-1; |
| 309 | 310 | while( lwr<=upr ){ |
| 310 | 311 | int mid, c; |
| 311 | 312 | mid = (upr+lwr)/2; |
| 312 | 313 | c = fossil_strcmp(zName, aMap[mid].zName); |
| @@ -318,11 +319,11 @@ | ||
| 318 | 319 | }else{ |
| 319 | 320 | lwr = mid + 1; |
| 320 | 321 | } |
| 321 | 322 | } |
| 322 | 323 | for(m=cnt=0, i=upr-2; cnt<2 && i<=upr+3 && i<nMap; i++){ |
| 323 | - if( i<0 ) continue; | |
| 324 | + if( i<iBegin ) continue; | |
| 324 | 325 | if( strncmp(zName, aMap[i].zName, n)==0 ){ |
| 325 | 326 | m = i; |
| 326 | 327 | cnt++; |
| 327 | 328 | } |
| 328 | 329 | } |
| @@ -655,11 +656,11 @@ | ||
| 655 | 656 | } |
| 656 | 657 | #ifndef _WIN32 |
| 657 | 658 | if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open"); |
| 658 | 659 | /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */ |
| 659 | 660 | #endif |
| 660 | - rc = name_search(zCmdName, aCommand, count(aCommand), &idx); | |
| 661 | + rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx); | |
| 661 | 662 | if( rc==1 ){ |
| 662 | 663 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 663 | 664 | if( !g.isHTTP && !g.fNoThHook ){ |
| 664 | 665 | rc = Th_CommandHook(zCmdName, 0); |
| 665 | 666 | }else{ |
| @@ -1015,11 +1016,11 @@ | ||
| 1015 | 1016 | zCmdOrPagePlural = "pages"; |
| 1016 | 1017 | }else{ |
| 1017 | 1018 | zCmdOrPage = "command"; |
| 1018 | 1019 | zCmdOrPagePlural = "commands"; |
| 1019 | 1020 | } |
| 1020 | - rc = name_search(g.argv[2], aCommand, count(aCommand), &idx); | |
| 1021 | + rc = name_search(g.argv[2], aCommand, count(aCommand), 0, &idx); | |
| 1021 | 1022 | if( rc==1 ){ |
| 1022 | 1023 | fossil_print("unknown %s: %s\nAvailable %s:\n", |
| 1023 | 1024 | zCmdOrPage, g.argv[2], zCmdOrPagePlural); |
| 1024 | 1025 | command_list(0, isPage ? CMDFLAG_WEBPAGE : (0xff & ~CMDFLAG_WEBPAGE)); |
| 1025 | 1026 | fossil_exit(1); |
| @@ -1059,11 +1060,11 @@ | ||
| 1059 | 1060 | int rc, idx; |
| 1060 | 1061 | char *z, *s, *d; |
| 1061 | 1062 | char const * zCmdOrPage = ('/'==*zCmd) ? "page" : "command"; |
| 1062 | 1063 | style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop); |
| 1063 | 1064 | @ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1> |
| 1064 | - rc = name_search(zCmd, aCommand, count(aCommand), &idx); | |
| 1065 | + rc = name_search(zCmd, aCommand, count(aCommand), 0, &idx); | |
| 1065 | 1066 | if( rc==1 ){ |
| 1066 | 1067 | @ unknown command: %s(zCmd) |
| 1067 | 1068 | }else if( rc==2 ){ |
| 1068 | 1069 | @ ambiguous command prefix: %s(zCmd) |
| 1069 | 1070 | }else{ |
| @@ -1561,11 +1562,11 @@ | ||
| 1561 | 1562 | } |
| 1562 | 1563 | |
| 1563 | 1564 | /* Locate the method specified by the path and execute the function |
| 1564 | 1565 | ** that implements that method. |
| 1565 | 1566 | */ |
| 1566 | - if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) ){ | |
| 1567 | + if( name_search(g.zPath, aWebpage, count(aWebpage), 0, &idx) ){ | |
| 1567 | 1568 | #ifdef FOSSIL_ENABLE_JSON |
| 1568 | 1569 | if(g.json.isJsonMode){ |
| 1569 | 1570 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0); |
| 1570 | 1571 | }else |
| 1571 | 1572 | #endif |
| 1572 | 1573 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -298,15 +298,16 @@ | |
| 298 | */ |
| 299 | static int name_search( |
| 300 | const char *zName, /* The name we are looking for */ |
| 301 | const NameMap *aMap, /* Search in this array */ |
| 302 | int nMap, /* Number of slots in aMap[] */ |
| 303 | int *pIndex /* OUT: The index in aMap[] of the match */ |
| 304 | ){ |
| 305 | int upr, lwr, cnt, m, i; |
| 306 | int n = strlen(zName); |
| 307 | lwr = 0; |
| 308 | upr = nMap-1; |
| 309 | while( lwr<=upr ){ |
| 310 | int mid, c; |
| 311 | mid = (upr+lwr)/2; |
| 312 | c = fossil_strcmp(zName, aMap[mid].zName); |
| @@ -318,11 +319,11 @@ | |
| 318 | }else{ |
| 319 | lwr = mid + 1; |
| 320 | } |
| 321 | } |
| 322 | for(m=cnt=0, i=upr-2; cnt<2 && i<=upr+3 && i<nMap; i++){ |
| 323 | if( i<0 ) continue; |
| 324 | if( strncmp(zName, aMap[i].zName, n)==0 ){ |
| 325 | m = i; |
| 326 | cnt++; |
| 327 | } |
| 328 | } |
| @@ -655,11 +656,11 @@ | |
| 655 | } |
| 656 | #ifndef _WIN32 |
| 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{ |
| @@ -1015,11 +1016,11 @@ | |
| 1015 | zCmdOrPagePlural = "pages"; |
| 1016 | }else{ |
| 1017 | zCmdOrPage = "command"; |
| 1018 | zCmdOrPagePlural = "commands"; |
| 1019 | } |
| 1020 | rc = name_search(g.argv[2], aCommand, count(aCommand), &idx); |
| 1021 | if( rc==1 ){ |
| 1022 | fossil_print("unknown %s: %s\nAvailable %s:\n", |
| 1023 | zCmdOrPage, g.argv[2], zCmdOrPagePlural); |
| 1024 | command_list(0, isPage ? CMDFLAG_WEBPAGE : (0xff & ~CMDFLAG_WEBPAGE)); |
| 1025 | fossil_exit(1); |
| @@ -1059,11 +1060,11 @@ | |
| 1059 | int rc, idx; |
| 1060 | char *z, *s, *d; |
| 1061 | char const * zCmdOrPage = ('/'==*zCmd) ? "page" : "command"; |
| 1062 | style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop); |
| 1063 | @ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1> |
| 1064 | rc = name_search(zCmd, aCommand, count(aCommand), &idx); |
| 1065 | if( rc==1 ){ |
| 1066 | @ unknown command: %s(zCmd) |
| 1067 | }else if( rc==2 ){ |
| 1068 | @ ambiguous command prefix: %s(zCmd) |
| 1069 | }else{ |
| @@ -1561,11 +1562,11 @@ | |
| 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 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -298,15 +298,16 @@ | |
| 298 | */ |
| 299 | static int name_search( |
| 300 | const char *zName, /* The name we are looking for */ |
| 301 | const NameMap *aMap, /* Search in this array */ |
| 302 | int nMap, /* Number of slots in aMap[] */ |
| 303 | int iBegin, /* Lower bound on the array search */ |
| 304 | int *pIndex /* OUT: The index in aMap[] of the match */ |
| 305 | ){ |
| 306 | int upr, lwr, cnt, m, i; |
| 307 | int n = strlen(zName); |
| 308 | lwr = iBegin; |
| 309 | upr = nMap-1; |
| 310 | while( lwr<=upr ){ |
| 311 | int mid, c; |
| 312 | mid = (upr+lwr)/2; |
| 313 | c = fossil_strcmp(zName, aMap[mid].zName); |
| @@ -318,11 +319,11 @@ | |
| 319 | }else{ |
| 320 | lwr = mid + 1; |
| 321 | } |
| 322 | } |
| 323 | for(m=cnt=0, i=upr-2; cnt<2 && i<=upr+3 && i<nMap; i++){ |
| 324 | if( i<iBegin ) continue; |
| 325 | if( strncmp(zName, aMap[i].zName, n)==0 ){ |
| 326 | m = i; |
| 327 | cnt++; |
| 328 | } |
| 329 | } |
| @@ -655,11 +656,11 @@ | |
| 656 | } |
| 657 | #ifndef _WIN32 |
| 658 | if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open"); |
| 659 | /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */ |
| 660 | #endif |
| 661 | rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx); |
| 662 | if( rc==1 ){ |
| 663 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 664 | if( !g.isHTTP && !g.fNoThHook ){ |
| 665 | rc = Th_CommandHook(zCmdName, 0); |
| 666 | }else{ |
| @@ -1015,11 +1016,11 @@ | |
| 1016 | zCmdOrPagePlural = "pages"; |
| 1017 | }else{ |
| 1018 | zCmdOrPage = "command"; |
| 1019 | zCmdOrPagePlural = "commands"; |
| 1020 | } |
| 1021 | rc = name_search(g.argv[2], aCommand, count(aCommand), 0, &idx); |
| 1022 | if( rc==1 ){ |
| 1023 | fossil_print("unknown %s: %s\nAvailable %s:\n", |
| 1024 | zCmdOrPage, g.argv[2], zCmdOrPagePlural); |
| 1025 | command_list(0, isPage ? CMDFLAG_WEBPAGE : (0xff & ~CMDFLAG_WEBPAGE)); |
| 1026 | fossil_exit(1); |
| @@ -1059,11 +1060,11 @@ | |
| 1060 | int rc, idx; |
| 1061 | char *z, *s, *d; |
| 1062 | char const * zCmdOrPage = ('/'==*zCmd) ? "page" : "command"; |
| 1063 | style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop); |
| 1064 | @ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1> |
| 1065 | rc = name_search(zCmd, aCommand, count(aCommand), 0, &idx); |
| 1066 | if( rc==1 ){ |
| 1067 | @ unknown command: %s(zCmd) |
| 1068 | }else if( rc==2 ){ |
| 1069 | @ ambiguous command prefix: %s(zCmd) |
| 1070 | }else{ |
| @@ -1561,11 +1562,11 @@ | |
| 1562 | } |
| 1563 | |
| 1564 | /* Locate the method specified by the path and execute the function |
| 1565 | ** that implements that method. |
| 1566 | */ |
| 1567 | if( name_search(g.zPath, aWebpage, count(aWebpage), 0, &idx) ){ |
| 1568 | #ifdef FOSSIL_ENABLE_JSON |
| 1569 | if(g.json.isJsonMode){ |
| 1570 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0); |
| 1571 | }else |
| 1572 | #endif |
| 1573 |
+1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -157,10 +157,11 @@ | ||
| 157 | 157 | |
| 158 | 158 | # Options used to compile the included SQLite shell on Windows. |
| 159 | 159 | # |
| 160 | 160 | set SHELL_WIN32_OPTIONS $SHELL_OPTIONS |
| 161 | 161 | lappend SHELL_WIN32_OPTIONS -Daccess=file_access |
| 162 | +lappend SHELL_WIN32_OPTIONS -Dsystem=fossil_system | |
| 162 | 163 | lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv |
| 163 | 164 | lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen |
| 164 | 165 | |
| 165 | 166 | # Name of the final application |
| 166 | 167 | # |
| 167 | 168 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -157,10 +157,11 @@ | |
| 157 | |
| 158 | # Options used to compile the included SQLite shell on Windows. |
| 159 | # |
| 160 | set SHELL_WIN32_OPTIONS $SHELL_OPTIONS |
| 161 | lappend SHELL_WIN32_OPTIONS -Daccess=file_access |
| 162 | lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv |
| 163 | lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen |
| 164 | |
| 165 | # Name of the final application |
| 166 | # |
| 167 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -157,10 +157,11 @@ | |
| 157 | |
| 158 | # Options used to compile the included SQLite shell on Windows. |
| 159 | # |
| 160 | set SHELL_WIN32_OPTIONS $SHELL_OPTIONS |
| 161 | lappend SHELL_WIN32_OPTIONS -Daccess=file_access |
| 162 | lappend SHELL_WIN32_OPTIONS -Dsystem=fossil_system |
| 163 | lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv |
| 164 | lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen |
| 165 | |
| 166 | # Name of the final application |
| 167 | # |
| 168 |
+32
-31
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -890,58 +890,58 @@ | ||
| 890 | 890 | SYNTAX("cluster contains a card other than M- or Z-"); |
| 891 | 891 | } |
| 892 | 892 | if( !seenZ ) SYNTAX("missing Z-card on cluster"); |
| 893 | 893 | p->type = CFTYPE_CLUSTER; |
| 894 | 894 | }else if( p->zEventId ){ |
| 895 | + if( p->zAttachName ) SYNTAX("A-card in event"); | |
| 896 | + if( p->zBaseline ) SYNTAX("B-card in event"); | |
| 895 | 897 | if( p->rDate<=0.0 ) SYNTAX("missing date on event"); |
| 896 | 898 | if( p->nFile>0 ) SYNTAX("F-card in event"); |
| 897 | - if( p->zRepoCksum ) SYNTAX("R-card in event"); | |
| 898 | - if( p->zBaseline ) SYNTAX("B-card in event"); | |
| 899 | 899 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 900 | 900 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 901 | 901 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 902 | + if( p->zRepoCksum ) SYNTAX("R-card in event"); | |
| 902 | 903 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 903 | - if( p->zAttachName ) SYNTAX("A-card in event"); | |
| 904 | 904 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 905 | 905 | p->type = CFTYPE_EVENT; |
| 906 | - }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ | |
| 906 | + }else if( p->zWiki!=0 || p->zWikiTitle!=0 ){ | |
| 907 | + if( p->zAttachName ) SYNTAX("A-card in wiki"); | |
| 908 | + if( p->zBaseline ) SYNTAX("B-card in wiki"); | |
| 909 | + if( p->rDate<=0.0 ) SYNTAX("missing date on wiki"); | |
| 910 | + if( p->nFile>0 ) SYNTAX("F-card in wiki"); | |
| 911 | + if( p->nField>0 ) SYNTAX("J-card in wiki"); | |
| 912 | + if( p->zTicketUuid ) SYNTAX("K-card in wiki"); | |
| 913 | + if( p->zWikiTitle==0 ) SYNTAX("missing L-card on wiki"); | |
| 914 | + if( p->zRepoCksum ) SYNTAX("R-card in wiki"); | |
| 915 | + if( p->nTag>0 ) SYNTAX("T-card in wiki"); | |
| 916 | + if( p->zWiki==0 ) SYNTAX("missing W-card on wiki"); | |
| 917 | + if( !seenZ ) SYNTAX("missing Z-card on wiki"); | |
| 918 | + p->type = CFTYPE_WIKI; | |
| 919 | + }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline | |
| 920 | + || p->nParent>0 ){ | |
| 921 | + if( p->zAttachName ) SYNTAX("A-card in manifest"); | |
| 907 | 922 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 908 | 923 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 909 | 924 | if( p->zTicketUuid ) SYNTAX("K-card in manifest"); |
| 910 | - if( p->zWiki ) SYNTAX("W-card in manifest"); | |
| 911 | - if( p->zWikiTitle ) SYNTAX("L-card in manifest"); | |
| 912 | - if( p->zTicketUuid ) SYNTAX("K-card in manifest"); | |
| 913 | - if( p->zAttachName ) SYNTAX("A-card in manifest"); | |
| 914 | 925 | p->type = CFTYPE_MANIFEST; |
| 915 | 926 | }else if( p->nField>0 || p->zTicketUuid!=0 ){ |
| 927 | + if( p->zAttachName ) SYNTAX("A-card in ticket"); | |
| 916 | 928 | if( p->rDate<=0.0 ) SYNTAX("missing date on ticket"); |
| 917 | - if( p->zWiki ) SYNTAX("W-card in ticket"); | |
| 918 | - if( p->zWikiTitle ) SYNTAX("L-card in ticket"); | |
| 919 | 929 | if( p->nField==0 ) SYNTAX("missing J-card on ticket"); |
| 930 | + if( p->zTicketUuid==0 ) SYNTAX("missing K-card on ticket"); | |
| 931 | + if( p->zMimetype) SYNTAX("N-card in ticket"); | |
| 920 | 932 | if( p->nTag>0 ) SYNTAX("T-card in ticket"); |
| 921 | - if( p->zTicketUuid==0 ) SYNTAX("missing K-card on ticket"); | |
| 922 | 933 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 923 | - if( p->zAttachName ) SYNTAX("A-card in ticket"); | |
| 924 | - if( p->zMimetype) SYNTAX("N-card in ticket"); | |
| 925 | 934 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 926 | 935 | p->type = CFTYPE_TICKET; |
| 927 | - }else if( p->zWiki!=0 || p->zWikiTitle!=0 ){ | |
| 928 | - if( p->rDate<=0.0 ) SYNTAX("missing date on wiki"); | |
| 929 | - if( p->nTag>0 ) SYNTAX("T-card in wiki"); | |
| 930 | - if( p->zWiki==0 ) SYNTAX("missing W-card on wiki"); | |
| 931 | - if( p->zWikiTitle==0 ) SYNTAX("missing L-card on wiki"); | |
| 932 | - if( p->zAttachName ) SYNTAX("A-card in wiki"); | |
| 933 | - if( !seenZ ) SYNTAX("missing Z-card on wiki"); | |
| 934 | - p->type = CFTYPE_WIKI; | |
| 935 | 936 | }else if( p->zAttachName ){ |
| 936 | 937 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 937 | 938 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 938 | 939 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 939 | 940 | p->type = CFTYPE_ATTACHMENT; |
| 940 | 941 | }else{ |
| 941 | 942 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 942 | - if( p->nParent>0 ) SYNTAX("P-card in control"); | |
| 943 | 943 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 944 | 944 | if( !seenZ ) SYNTAX("missing Z-card on control"); |
| 945 | 945 | p->type = CFTYPE_CONTROL; |
| 946 | 946 | } |
| 947 | 947 | md5sum_init(); |
| @@ -1261,10 +1261,11 @@ | ||
| 1261 | 1261 | p->iFile = i; |
| 1262 | 1262 | return &p->aFile[i]; |
| 1263 | 1263 | } |
| 1264 | 1264 | } |
| 1265 | 1265 | if( bBest ){ |
| 1266 | + if( lwr>=p->nFile ) lwr = p->nFile-1; | |
| 1266 | 1267 | i = (int)strlen(zName); |
| 1267 | 1268 | if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr]; |
| 1268 | 1269 | } |
| 1269 | 1270 | return 0; |
| 1270 | 1271 | } |
| @@ -1598,40 +1599,40 @@ | ||
| 1598 | 1599 | if( fossil_strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){ |
| 1599 | 1600 | zNewStatus = pManifest->aField[i].zValue; |
| 1600 | 1601 | } |
| 1601 | 1602 | } |
| 1602 | 1603 | if( zNewStatus ){ |
| 1603 | - blob_appendf(&comment, "%h ticket [%s|%.10s]: <i>%h</i>", | |
| 1604 | + blob_appendf(&comment, "%h ticket [%s|%S]: <i>%h</i>", | |
| 1604 | 1605 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1605 | 1606 | ); |
| 1606 | 1607 | if( pManifest->nField>1 ){ |
| 1607 | 1608 | blob_appendf(&comment, " plus %d other change%s", |
| 1608 | 1609 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1609 | 1610 | } |
| 1610 | - blob_appendf(&brief, "%h ticket [%s|%.10s].", | |
| 1611 | + blob_appendf(&brief, "%h ticket [%s|%S].", | |
| 1611 | 1612 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid); |
| 1612 | 1613 | }else{ |
| 1613 | 1614 | zNewStatus = db_text("unknown", |
| 1614 | 1615 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1615 | 1616 | zStatusColumn, pManifest->zTicketUuid |
| 1616 | 1617 | ); |
| 1617 | - blob_appendf(&comment, "Ticket [%s|%.10s] <i>%h</i> status still %h with " | |
| 1618 | + blob_appendf(&comment, "Ticket [%s|%S] <i>%h</i> status still %h with " | |
| 1618 | 1619 | "%d other change%s", |
| 1619 | 1620 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus, |
| 1620 | 1621 | pManifest->nField, pManifest->nField==1 ? "" : "s" |
| 1621 | 1622 | ); |
| 1622 | 1623 | fossil_free(zNewStatus); |
| 1623 | - blob_appendf(&brief, "Ticket [%s|%.10s]: %d change%s", | |
| 1624 | + blob_appendf(&brief, "Ticket [%s|%S]: %d change%s", | |
| 1624 | 1625 | pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField, |
| 1625 | 1626 | pManifest->nField==1 ? "" : "s" |
| 1626 | 1627 | ); |
| 1627 | 1628 | } |
| 1628 | 1629 | }else{ |
| 1629 | - blob_appendf(&comment, "New ticket [%s|%.10s] <i>%h</i>.", | |
| 1630 | + blob_appendf(&comment, "New ticket [%s|%S] <i>%h</i>.", | |
| 1630 | 1631 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1631 | 1632 | ); |
| 1632 | - blob_appendf(&brief, "New ticket [%s|%.10s].", pManifest->zTicketUuid, | |
| 1633 | + blob_appendf(&brief, "New ticket [%s|%S].", pManifest->zTicketUuid, | |
| 1633 | 1634 | pManifest->zTicketUuid); |
| 1634 | 1635 | } |
| 1635 | 1636 | fossil_free(zTitle); |
| 1636 | 1637 | db_multi_exec( |
| 1637 | 1638 | "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)" |
| @@ -1950,14 +1951,14 @@ | ||
| 1950 | 1951 | p->zAttachName, p->zAttachTarget); |
| 1951 | 1952 | } |
| 1952 | 1953 | }else{ |
| 1953 | 1954 | if( isAdd ){ |
| 1954 | 1955 | zComment = mprintf( |
| 1955 | - "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]", | |
| 1956 | + "Add attachment [/artifact/%s|%h] to ticket [%s|%S]", | |
| 1956 | 1957 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1957 | 1958 | }else{ |
| 1958 | - zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]", | |
| 1959 | + zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%S]", | |
| 1959 | 1960 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1960 | 1961 | } |
| 1961 | 1962 | } |
| 1962 | 1963 | db_multi_exec( |
| 1963 | 1964 | "REPLACE INTO event(type,mtime,objid,user,comment)" |
| @@ -1982,11 +1983,11 @@ | ||
| 1982 | 1983 | for(i=0; i<p->nTag; i++){ |
| 1983 | 1984 | zTagUuid = p->aTag[i].zUuid; |
| 1984 | 1985 | if( !zTagUuid ) continue; |
| 1985 | 1986 | if( i==0 || fossil_strcmp(zTagUuid, p->aTag[i-1].zUuid)!=0 ){ |
| 1986 | 1987 | blob_appendf(&comment, |
| 1987 | - " Edit [%s|%.10s]:", | |
| 1988 | + " Edit [%s|%S]:", | |
| 1988 | 1989 | zTagUuid, zTagUuid); |
| 1989 | 1990 | branchMove = 0; |
| 1990 | 1991 | if( permitHooks && db_exists("SELECT 1 FROM event, blob" |
| 1991 | 1992 | " WHERE event.type='ci' AND event.objid=blob.rid" |
| 1992 | 1993 | " AND blob.uuid='%s'", zTagUuid) ){ |
| 1993 | 1994 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -890,58 +890,58 @@ | |
| 890 | SYNTAX("cluster contains a card other than M- or Z-"); |
| 891 | } |
| 892 | if( !seenZ ) SYNTAX("missing Z-card on cluster"); |
| 893 | p->type = CFTYPE_CLUSTER; |
| 894 | }else if( p->zEventId ){ |
| 895 | if( p->rDate<=0.0 ) SYNTAX("missing date on event"); |
| 896 | if( p->nFile>0 ) SYNTAX("F-card in event"); |
| 897 | if( p->zRepoCksum ) SYNTAX("R-card in event"); |
| 898 | if( p->zBaseline ) SYNTAX("B-card in event"); |
| 899 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 900 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 901 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 902 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 903 | if( p->zAttachName ) SYNTAX("A-card in event"); |
| 904 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 905 | p->type = CFTYPE_EVENT; |
| 906 | }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ |
| 907 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 908 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 909 | if( p->zTicketUuid ) SYNTAX("K-card in manifest"); |
| 910 | if( p->zWiki ) SYNTAX("W-card in manifest"); |
| 911 | if( p->zWikiTitle ) SYNTAX("L-card in manifest"); |
| 912 | if( p->zTicketUuid ) SYNTAX("K-card in manifest"); |
| 913 | if( p->zAttachName ) SYNTAX("A-card in manifest"); |
| 914 | p->type = CFTYPE_MANIFEST; |
| 915 | }else if( p->nField>0 || p->zTicketUuid!=0 ){ |
| 916 | if( p->rDate<=0.0 ) SYNTAX("missing date on ticket"); |
| 917 | if( p->zWiki ) SYNTAX("W-card in ticket"); |
| 918 | if( p->zWikiTitle ) SYNTAX("L-card in ticket"); |
| 919 | if( p->nField==0 ) SYNTAX("missing J-card on ticket"); |
| 920 | if( p->nTag>0 ) SYNTAX("T-card in ticket"); |
| 921 | if( p->zTicketUuid==0 ) SYNTAX("missing K-card on ticket"); |
| 922 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 923 | if( p->zAttachName ) SYNTAX("A-card in ticket"); |
| 924 | if( p->zMimetype) SYNTAX("N-card in ticket"); |
| 925 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 926 | p->type = CFTYPE_TICKET; |
| 927 | }else if( p->zWiki!=0 || p->zWikiTitle!=0 ){ |
| 928 | if( p->rDate<=0.0 ) SYNTAX("missing date on wiki"); |
| 929 | if( p->nTag>0 ) SYNTAX("T-card in wiki"); |
| 930 | if( p->zWiki==0 ) SYNTAX("missing W-card on wiki"); |
| 931 | if( p->zWikiTitle==0 ) SYNTAX("missing L-card on wiki"); |
| 932 | if( p->zAttachName ) SYNTAX("A-card in wiki"); |
| 933 | if( !seenZ ) SYNTAX("missing Z-card on wiki"); |
| 934 | p->type = CFTYPE_WIKI; |
| 935 | }else if( p->zAttachName ){ |
| 936 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 937 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 938 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 939 | p->type = CFTYPE_ATTACHMENT; |
| 940 | }else{ |
| 941 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 942 | if( p->nParent>0 ) SYNTAX("P-card in control"); |
| 943 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 944 | if( !seenZ ) SYNTAX("missing Z-card on control"); |
| 945 | p->type = CFTYPE_CONTROL; |
| 946 | } |
| 947 | md5sum_init(); |
| @@ -1261,10 +1261,11 @@ | |
| 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 | } |
| @@ -1598,40 +1599,40 @@ | |
| 1598 | if( fossil_strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){ |
| 1599 | zNewStatus = pManifest->aField[i].zValue; |
| 1600 | } |
| 1601 | } |
| 1602 | if( zNewStatus ){ |
| 1603 | blob_appendf(&comment, "%h ticket [%s|%.10s]: <i>%h</i>", |
| 1604 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1605 | ); |
| 1606 | if( pManifest->nField>1 ){ |
| 1607 | blob_appendf(&comment, " plus %d other change%s", |
| 1608 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1609 | } |
| 1610 | blob_appendf(&brief, "%h ticket [%s|%.10s].", |
| 1611 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid); |
| 1612 | }else{ |
| 1613 | zNewStatus = db_text("unknown", |
| 1614 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1615 | zStatusColumn, pManifest->zTicketUuid |
| 1616 | ); |
| 1617 | blob_appendf(&comment, "Ticket [%s|%.10s] <i>%h</i> status still %h with " |
| 1618 | "%d other change%s", |
| 1619 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus, |
| 1620 | pManifest->nField, pManifest->nField==1 ? "" : "s" |
| 1621 | ); |
| 1622 | fossil_free(zNewStatus); |
| 1623 | blob_appendf(&brief, "Ticket [%s|%.10s]: %d change%s", |
| 1624 | pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField, |
| 1625 | pManifest->nField==1 ? "" : "s" |
| 1626 | ); |
| 1627 | } |
| 1628 | }else{ |
| 1629 | blob_appendf(&comment, "New ticket [%s|%.10s] <i>%h</i>.", |
| 1630 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1631 | ); |
| 1632 | blob_appendf(&brief, "New ticket [%s|%.10s].", pManifest->zTicketUuid, |
| 1633 | pManifest->zTicketUuid); |
| 1634 | } |
| 1635 | fossil_free(zTitle); |
| 1636 | db_multi_exec( |
| 1637 | "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)" |
| @@ -1950,14 +1951,14 @@ | |
| 1950 | p->zAttachName, p->zAttachTarget); |
| 1951 | } |
| 1952 | }else{ |
| 1953 | if( isAdd ){ |
| 1954 | zComment = mprintf( |
| 1955 | "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]", |
| 1956 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1957 | }else{ |
| 1958 | zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]", |
| 1959 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1960 | } |
| 1961 | } |
| 1962 | db_multi_exec( |
| 1963 | "REPLACE INTO event(type,mtime,objid,user,comment)" |
| @@ -1982,11 +1983,11 @@ | |
| 1982 | for(i=0; i<p->nTag; i++){ |
| 1983 | zTagUuid = p->aTag[i].zUuid; |
| 1984 | if( !zTagUuid ) continue; |
| 1985 | if( i==0 || fossil_strcmp(zTagUuid, p->aTag[i-1].zUuid)!=0 ){ |
| 1986 | blob_appendf(&comment, |
| 1987 | " Edit [%s|%.10s]:", |
| 1988 | zTagUuid, zTagUuid); |
| 1989 | branchMove = 0; |
| 1990 | if( permitHooks && db_exists("SELECT 1 FROM event, blob" |
| 1991 | " WHERE event.type='ci' AND event.objid=blob.rid" |
| 1992 | " AND blob.uuid='%s'", zTagUuid) ){ |
| 1993 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -890,58 +890,58 @@ | |
| 890 | SYNTAX("cluster contains a card other than M- or Z-"); |
| 891 | } |
| 892 | if( !seenZ ) SYNTAX("missing Z-card on cluster"); |
| 893 | p->type = CFTYPE_CLUSTER; |
| 894 | }else if( p->zEventId ){ |
| 895 | if( p->zAttachName ) SYNTAX("A-card in event"); |
| 896 | if( p->zBaseline ) SYNTAX("B-card in event"); |
| 897 | if( p->rDate<=0.0 ) SYNTAX("missing date on event"); |
| 898 | if( p->nFile>0 ) SYNTAX("F-card in event"); |
| 899 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 900 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 901 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 902 | if( p->zRepoCksum ) SYNTAX("R-card in event"); |
| 903 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 904 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 905 | p->type = CFTYPE_EVENT; |
| 906 | }else if( p->zWiki!=0 || p->zWikiTitle!=0 ){ |
| 907 | if( p->zAttachName ) SYNTAX("A-card in wiki"); |
| 908 | if( p->zBaseline ) SYNTAX("B-card in wiki"); |
| 909 | if( p->rDate<=0.0 ) SYNTAX("missing date on wiki"); |
| 910 | if( p->nFile>0 ) SYNTAX("F-card in wiki"); |
| 911 | if( p->nField>0 ) SYNTAX("J-card in wiki"); |
| 912 | if( p->zTicketUuid ) SYNTAX("K-card in wiki"); |
| 913 | if( p->zWikiTitle==0 ) SYNTAX("missing L-card on wiki"); |
| 914 | if( p->zRepoCksum ) SYNTAX("R-card in wiki"); |
| 915 | if( p->nTag>0 ) SYNTAX("T-card in wiki"); |
| 916 | if( p->zWiki==0 ) SYNTAX("missing W-card on wiki"); |
| 917 | if( !seenZ ) SYNTAX("missing Z-card on wiki"); |
| 918 | p->type = CFTYPE_WIKI; |
| 919 | }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline |
| 920 | || p->nParent>0 ){ |
| 921 | if( p->zAttachName ) SYNTAX("A-card in manifest"); |
| 922 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 923 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 924 | if( p->zTicketUuid ) SYNTAX("K-card in manifest"); |
| 925 | p->type = CFTYPE_MANIFEST; |
| 926 | }else if( p->nField>0 || p->zTicketUuid!=0 ){ |
| 927 | if( p->zAttachName ) SYNTAX("A-card in ticket"); |
| 928 | if( p->rDate<=0.0 ) SYNTAX("missing date on ticket"); |
| 929 | if( p->nField==0 ) SYNTAX("missing J-card on ticket"); |
| 930 | if( p->zTicketUuid==0 ) SYNTAX("missing K-card on ticket"); |
| 931 | if( p->zMimetype) SYNTAX("N-card in ticket"); |
| 932 | if( p->nTag>0 ) SYNTAX("T-card in ticket"); |
| 933 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 934 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 935 | p->type = CFTYPE_TICKET; |
| 936 | }else if( p->zAttachName ){ |
| 937 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 938 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 939 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 940 | p->type = CFTYPE_ATTACHMENT; |
| 941 | }else{ |
| 942 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 943 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 944 | if( !seenZ ) SYNTAX("missing Z-card on control"); |
| 945 | p->type = CFTYPE_CONTROL; |
| 946 | } |
| 947 | md5sum_init(); |
| @@ -1261,10 +1261,11 @@ | |
| 1261 | p->iFile = i; |
| 1262 | return &p->aFile[i]; |
| 1263 | } |
| 1264 | } |
| 1265 | if( bBest ){ |
| 1266 | if( lwr>=p->nFile ) lwr = p->nFile-1; |
| 1267 | i = (int)strlen(zName); |
| 1268 | if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr]; |
| 1269 | } |
| 1270 | return 0; |
| 1271 | } |
| @@ -1598,40 +1599,40 @@ | |
| 1599 | if( fossil_strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){ |
| 1600 | zNewStatus = pManifest->aField[i].zValue; |
| 1601 | } |
| 1602 | } |
| 1603 | if( zNewStatus ){ |
| 1604 | blob_appendf(&comment, "%h ticket [%s|%S]: <i>%h</i>", |
| 1605 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1606 | ); |
| 1607 | if( pManifest->nField>1 ){ |
| 1608 | blob_appendf(&comment, " plus %d other change%s", |
| 1609 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1610 | } |
| 1611 | blob_appendf(&brief, "%h ticket [%s|%S].", |
| 1612 | zNewStatus, pManifest->zTicketUuid, pManifest->zTicketUuid); |
| 1613 | }else{ |
| 1614 | zNewStatus = db_text("unknown", |
| 1615 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1616 | zStatusColumn, pManifest->zTicketUuid |
| 1617 | ); |
| 1618 | blob_appendf(&comment, "Ticket [%s|%S] <i>%h</i> status still %h with " |
| 1619 | "%d other change%s", |
| 1620 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus, |
| 1621 | pManifest->nField, pManifest->nField==1 ? "" : "s" |
| 1622 | ); |
| 1623 | fossil_free(zNewStatus); |
| 1624 | blob_appendf(&brief, "Ticket [%s|%S]: %d change%s", |
| 1625 | pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField, |
| 1626 | pManifest->nField==1 ? "" : "s" |
| 1627 | ); |
| 1628 | } |
| 1629 | }else{ |
| 1630 | blob_appendf(&comment, "New ticket [%s|%S] <i>%h</i>.", |
| 1631 | pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle |
| 1632 | ); |
| 1633 | blob_appendf(&brief, "New ticket [%s|%S].", pManifest->zTicketUuid, |
| 1634 | pManifest->zTicketUuid); |
| 1635 | } |
| 1636 | fossil_free(zTitle); |
| 1637 | db_multi_exec( |
| 1638 | "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)" |
| @@ -1950,14 +1951,14 @@ | |
| 1951 | p->zAttachName, p->zAttachTarget); |
| 1952 | } |
| 1953 | }else{ |
| 1954 | if( isAdd ){ |
| 1955 | zComment = mprintf( |
| 1956 | "Add attachment [/artifact/%s|%h] to ticket [%s|%S]", |
| 1957 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1958 | }else{ |
| 1959 | zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%S]", |
| 1960 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1961 | } |
| 1962 | } |
| 1963 | db_multi_exec( |
| 1964 | "REPLACE INTO event(type,mtime,objid,user,comment)" |
| @@ -1982,11 +1983,11 @@ | |
| 1983 | for(i=0; i<p->nTag; i++){ |
| 1984 | zTagUuid = p->aTag[i].zUuid; |
| 1985 | if( !zTagUuid ) continue; |
| 1986 | if( i==0 || fossil_strcmp(zTagUuid, p->aTag[i-1].zUuid)!=0 ){ |
| 1987 | blob_appendf(&comment, |
| 1988 | " Edit [%s|%S]:", |
| 1989 | zTagUuid, zTagUuid); |
| 1990 | branchMove = 0; |
| 1991 | if( permitHooks && db_exists("SELECT 1 FROM event, blob" |
| 1992 | " WHERE event.type='ci' AND event.objid=blob.rid" |
| 1993 | " AND blob.uuid='%s'", zTagUuid) ){ |
| 1994 |
+2
-1
| --- src/mkindex.c | ||
| +++ src/mkindex.c | ||
| @@ -283,11 +283,11 @@ | ||
| 283 | 283 | ); |
| 284 | 284 | for(i=0; i<nFixed /*&& aEntry[i].eType==1*/; i++){ |
| 285 | 285 | const char *z = aEntry[i].zPath; |
| 286 | 286 | int n = strlen(z); |
| 287 | 287 | int cmdFlags = (1==aEntry[i].eType) ? 0x01 : 0x08; |
| 288 | - if(0x01==cmdFlags){ | |
| 288 | + if( 0x01==cmdFlags ){ | |
| 289 | 289 | if( z[n-1]=='*' ){ |
| 290 | 290 | n--; |
| 291 | 291 | cmdFlags = 0x02; |
| 292 | 292 | }else if( memcmp(z, "test-", 5)==0 ){ |
| 293 | 293 | cmdFlags = 0x04; |
| @@ -303,10 +303,11 @@ | ||
| 303 | 303 | cmdFlags |
| 304 | 304 | ); |
| 305 | 305 | if( aEntry[i].zIf ) printf("#endif\n"); |
| 306 | 306 | } |
| 307 | 307 | printf("};\n"); |
| 308 | + printf("#define FOSSIL_FIRST_CMD (sizeof(aWebpage)/sizeof(aWebpage[0]))\n"); | |
| 308 | 309 | for(i=0; i<nFixed; i++){ |
| 309 | 310 | char *z = aEntry[i].zHelp; |
| 310 | 311 | if( z && z[0] ){ |
| 311 | 312 | if( aEntry[i].zIf ) printf("%s", aEntry[i].zIf); |
| 312 | 313 | printf("static const char zHelp_%s[] = \n", aEntry[i].zFunc); |
| 313 | 314 |
| --- src/mkindex.c | |
| +++ src/mkindex.c | |
| @@ -283,11 +283,11 @@ | |
| 283 | ); |
| 284 | for(i=0; i<nFixed /*&& aEntry[i].eType==1*/; i++){ |
| 285 | const char *z = aEntry[i].zPath; |
| 286 | int n = strlen(z); |
| 287 | int cmdFlags = (1==aEntry[i].eType) ? 0x01 : 0x08; |
| 288 | if(0x01==cmdFlags){ |
| 289 | if( z[n-1]=='*' ){ |
| 290 | n--; |
| 291 | cmdFlags = 0x02; |
| 292 | }else if( memcmp(z, "test-", 5)==0 ){ |
| 293 | cmdFlags = 0x04; |
| @@ -303,10 +303,11 @@ | |
| 303 | cmdFlags |
| 304 | ); |
| 305 | if( aEntry[i].zIf ) printf("#endif\n"); |
| 306 | } |
| 307 | printf("};\n"); |
| 308 | for(i=0; i<nFixed; i++){ |
| 309 | char *z = aEntry[i].zHelp; |
| 310 | if( z && z[0] ){ |
| 311 | if( aEntry[i].zIf ) printf("%s", aEntry[i].zIf); |
| 312 | printf("static const char zHelp_%s[] = \n", aEntry[i].zFunc); |
| 313 |
| --- src/mkindex.c | |
| +++ src/mkindex.c | |
| @@ -283,11 +283,11 @@ | |
| 283 | ); |
| 284 | for(i=0; i<nFixed /*&& aEntry[i].eType==1*/; i++){ |
| 285 | const char *z = aEntry[i].zPath; |
| 286 | int n = strlen(z); |
| 287 | int cmdFlags = (1==aEntry[i].eType) ? 0x01 : 0x08; |
| 288 | if( 0x01==cmdFlags ){ |
| 289 | if( z[n-1]=='*' ){ |
| 290 | n--; |
| 291 | cmdFlags = 0x02; |
| 292 | }else if( memcmp(z, "test-", 5)==0 ){ |
| 293 | cmdFlags = 0x04; |
| @@ -303,10 +303,11 @@ | |
| 303 | cmdFlags |
| 304 | ); |
| 305 | if( aEntry[i].zIf ) printf("#endif\n"); |
| 306 | } |
| 307 | printf("};\n"); |
| 308 | printf("#define FOSSIL_FIRST_CMD (sizeof(aWebpage)/sizeof(aWebpage[0]))\n"); |
| 309 | for(i=0; i<nFixed; i++){ |
| 310 | char *z = aEntry[i].zHelp; |
| 311 | if( z && z[0] ){ |
| 312 | if( aEntry[i].zIf ) printf("%s", aEntry[i].zIf); |
| 313 | printf("static const char zHelp_%s[] = \n", aEntry[i].zFunc); |
| 314 |
+3
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -444,11 +444,11 @@ | ||
| 444 | 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | 446 | " GROUP BY tkt_uuid" |
| 447 | 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | - int rid = db_column_int(&q, 0); | |
| 449 | + int rid = db_column_int(&q, 0); | |
| 450 | 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | 453 | @ %s(zUuid)</a> - |
| 454 | 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | ||
| 465 | 465 | "SELECT rid, uuid FROM" |
| 466 | 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | - int rid = db_column_int(&q, 0); | |
| 470 | + int rid = db_column_int(&q, 0); | |
| 471 | 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | 473 | @ %s(zUuid)</a> - |
| 474 | 474 | @ <ul><li> |
| 475 | 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | ||
| 599 | 599 | " AND blob.rid=mlink.mid" |
| 600 | 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | 601 | timeline_utc(), rid); |
| 602 | 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 604 | - fossil_print(" part of [%.10s] by %s on %s\n", | |
| 604 | + fossil_print(" part of [%S] 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 | 609 | comment_print(db_column_text(&q,4), 12, -1, COMMENT_PRINT_DEFAULT); |
| 610 | 610 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -444,11 +444,11 @@ | |
| 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | " GROUP BY tkt_uuid" |
| 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | int rid = db_column_int(&q, 0); |
| 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | @ %s(zUuid)</a> - |
| 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | |
| 465 | "SELECT rid, uuid FROM" |
| 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | int rid = db_column_int(&q, 0); |
| 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | @ %s(zUuid)</a> - |
| 474 | @ <ul><li> |
| 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | |
| 599 | " AND blob.rid=mlink.mid" |
| 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | timeline_utc(), rid); |
| 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 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, COMMENT_PRINT_DEFAULT); |
| 610 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -444,11 +444,11 @@ | |
| 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | " GROUP BY tkt_uuid" |
| 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | int rid = db_column_int(&q, 0); |
| 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | @ %s(zUuid)</a> - |
| 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | |
| 465 | "SELECT rid, uuid FROM" |
| 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | int rid = db_column_int(&q, 0); |
| 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | @ %s(zUuid)</a> - |
| 474 | @ <ul><li> |
| 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | |
| 599 | " AND blob.rid=mlink.mid" |
| 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | timeline_utc(), rid); |
| 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 604 | fossil_print(" part of [%S] 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, COMMENT_PRINT_DEFAULT); |
| 610 |
+3
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -444,11 +444,11 @@ | ||
| 444 | 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | 446 | " GROUP BY tkt_uuid" |
| 447 | 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | - int rid = db_column_int(&q, 0); | |
| 449 | + int rid = db_column_int(&q, 0); | |
| 450 | 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | 453 | @ %s(zUuid)</a> - |
| 454 | 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | ||
| 465 | 465 | "SELECT rid, uuid FROM" |
| 466 | 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | - int rid = db_column_int(&q, 0); | |
| 470 | + int rid = db_column_int(&q, 0); | |
| 471 | 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | 473 | @ %s(zUuid)</a> - |
| 474 | 474 | @ <ul><li> |
| 475 | 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | ||
| 599 | 599 | " AND blob.rid=mlink.mid" |
| 600 | 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | 601 | timeline_utc(), rid); |
| 602 | 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 604 | - fossil_print(" part of [%.10s] by %s on %s\n", | |
| 604 | + fossil_print(" part of [%S] 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 | 609 | comment_print(db_column_text(&q,4), 12, -1, COMMENT_PRINT_DEFAULT); |
| 610 | 610 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -444,11 +444,11 @@ | |
| 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | " GROUP BY tkt_uuid" |
| 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | int rid = db_column_int(&q, 0); |
| 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | @ %s(zUuid)</a> - |
| 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | |
| 465 | "SELECT rid, uuid FROM" |
| 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | int rid = db_column_int(&q, 0); |
| 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | @ %s(zUuid)</a> - |
| 474 | @ <ul><li> |
| 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | |
| 599 | " AND blob.rid=mlink.mid" |
| 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | timeline_utc(), rid); |
| 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 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, COMMENT_PRINT_DEFAULT); |
| 610 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -444,11 +444,11 @@ | |
| 444 | " WHERE ticket.tkt_id = ticketchng.tkt_id" |
| 445 | " AND tkt_uuid GLOB '%q*'" |
| 446 | " GROUP BY tkt_uuid" |
| 447 | " ORDER BY tkt_ctime DESC", z); |
| 448 | while( db_step(&q)==SQLITE_ROW ){ |
| 449 | int rid = db_column_int(&q, 0); |
| 450 | const char *zUuid = db_column_text(&q, 1); |
| 451 | const char *zTitle = db_column_text(&q, 2); |
| 452 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 453 | @ %s(zUuid)</a> - |
| 454 | @ <ul></ul> |
| @@ -465,11 +465,11 @@ | |
| 465 | "SELECT rid, uuid FROM" |
| 466 | " (SELECT tagxref.rid AS rid, substr(tagname, 7) AS uuid" |
| 467 | " FROM tagxref, tag WHERE tagxref.tagid = tag.tagid" |
| 468 | " AND tagname GLOB 'event-%q*') GROUP BY uuid", z); |
| 469 | while( db_step(&q)==SQLITE_ROW ){ |
| 470 | int rid = db_column_int(&q, 0); |
| 471 | const char* zUuid = db_column_text(&q, 1); |
| 472 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 473 | @ %s(zUuid)</a> - |
| 474 | @ <ul><li> |
| 475 | object_description(rid, 0, 0); |
| @@ -599,11 +599,11 @@ | |
| 599 | " AND blob.rid=mlink.mid" |
| 600 | " ORDER BY event.mtime DESC /*sort*/", |
| 601 | timeline_utc(), rid); |
| 602 | while( db_step(&q)==SQLITE_ROW ){ |
| 603 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 604 | fossil_print(" part of [%S] 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, COMMENT_PRINT_DEFAULT); |
| 610 |
+8
-4
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -608,22 +608,26 @@ | ||
| 608 | 608 | case etROOT: { |
| 609 | 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | 610 | length = (int)strlen(bufpt); |
| 611 | 611 | break; |
| 612 | 612 | } |
| 613 | - case etSTRINGID: { | |
| 614 | - precision = 16; | |
| 615 | - /* Fall through */ | |
| 616 | - } | |
| 613 | + case etSTRINGID: | |
| 617 | 614 | case etSTRING: |
| 618 | 615 | case etDYNSTRING: { |
| 619 | 616 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 620 | 617 | bufpt = va_arg(ap,char*); |
| 621 | 618 | if( bufpt==0 ){ |
| 622 | 619 | bufpt = ""; |
| 623 | 620 | }else if( xtype==etDYNSTRING ){ |
| 624 | 621 | zExtra = bufpt; |
| 622 | + }else if( xtype==etSTRINGID ){ | |
| 623 | + precision = 0; | |
| 624 | + while( bufpt[precision]>='0' && bufpt[precision]<='9' ){ | |
| 625 | + precision++; | |
| 626 | + } | |
| 627 | + if( bufpt[precision]!=0 ) precision++; | |
| 628 | + if( precision<10 ) precision=10; | |
| 625 | 629 | } |
| 626 | 630 | length = StrNLen32(bufpt, limit); |
| 627 | 631 | if( precision>=0 && precision<length ) length = precision; |
| 628 | 632 | break; |
| 629 | 633 | } |
| 630 | 634 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -608,22 +608,26 @@ | |
| 608 | case etROOT: { |
| 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | length = (int)strlen(bufpt); |
| 611 | break; |
| 612 | } |
| 613 | case etSTRINGID: { |
| 614 | precision = 16; |
| 615 | /* Fall through */ |
| 616 | } |
| 617 | case etSTRING: |
| 618 | case etDYNSTRING: { |
| 619 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 620 | bufpt = va_arg(ap,char*); |
| 621 | if( bufpt==0 ){ |
| 622 | bufpt = ""; |
| 623 | }else if( xtype==etDYNSTRING ){ |
| 624 | zExtra = bufpt; |
| 625 | } |
| 626 | length = StrNLen32(bufpt, limit); |
| 627 | if( precision>=0 && precision<length ) length = precision; |
| 628 | break; |
| 629 | } |
| 630 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -608,22 +608,26 @@ | |
| 608 | case etROOT: { |
| 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | length = (int)strlen(bufpt); |
| 611 | break; |
| 612 | } |
| 613 | case etSTRINGID: |
| 614 | case etSTRING: |
| 615 | case etDYNSTRING: { |
| 616 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 617 | bufpt = va_arg(ap,char*); |
| 618 | if( bufpt==0 ){ |
| 619 | bufpt = ""; |
| 620 | }else if( xtype==etDYNSTRING ){ |
| 621 | zExtra = bufpt; |
| 622 | }else if( xtype==etSTRINGID ){ |
| 623 | precision = 0; |
| 624 | while( bufpt[precision]>='0' && bufpt[precision]<='9' ){ |
| 625 | precision++; |
| 626 | } |
| 627 | if( bufpt[precision]!=0 ) precision++; |
| 628 | if( precision<10 ) precision=10; |
| 629 | } |
| 630 | length = StrNLen32(bufpt, limit); |
| 631 | if( precision>=0 && precision<length ) length = precision; |
| 632 | break; |
| 633 | } |
| 634 |
+8
-4
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -608,22 +608,26 @@ | ||
| 608 | 608 | case etROOT: { |
| 609 | 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | 610 | length = (int)strlen(bufpt); |
| 611 | 611 | break; |
| 612 | 612 | } |
| 613 | - case etSTRINGID: { | |
| 614 | - precision = 16; | |
| 615 | - /* Fall through */ | |
| 616 | - } | |
| 613 | + case etSTRINGID: | |
| 617 | 614 | case etSTRING: |
| 618 | 615 | case etDYNSTRING: { |
| 619 | 616 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 620 | 617 | bufpt = va_arg(ap,char*); |
| 621 | 618 | if( bufpt==0 ){ |
| 622 | 619 | bufpt = ""; |
| 623 | 620 | }else if( xtype==etDYNSTRING ){ |
| 624 | 621 | zExtra = bufpt; |
| 622 | + }else if( xtype==etSTRINGID ){ | |
| 623 | + precision = 0; | |
| 624 | + while( bufpt[precision]>='0' && bufpt[precision]<='9' ){ | |
| 625 | + precision++; | |
| 626 | + } | |
| 627 | + if( bufpt[precision]!=0 ) precision++; | |
| 628 | + if( precision<10 ) precision=10; | |
| 625 | 629 | } |
| 626 | 630 | length = StrNLen32(bufpt, limit); |
| 627 | 631 | if( precision>=0 && precision<length ) length = precision; |
| 628 | 632 | break; |
| 629 | 633 | } |
| 630 | 634 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -608,22 +608,26 @@ | |
| 608 | case etROOT: { |
| 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | length = (int)strlen(bufpt); |
| 611 | break; |
| 612 | } |
| 613 | case etSTRINGID: { |
| 614 | precision = 16; |
| 615 | /* Fall through */ |
| 616 | } |
| 617 | case etSTRING: |
| 618 | case etDYNSTRING: { |
| 619 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 620 | bufpt = va_arg(ap,char*); |
| 621 | if( bufpt==0 ){ |
| 622 | bufpt = ""; |
| 623 | }else if( xtype==etDYNSTRING ){ |
| 624 | zExtra = bufpt; |
| 625 | } |
| 626 | length = StrNLen32(bufpt, limit); |
| 627 | if( precision>=0 && precision<length ) length = precision; |
| 628 | break; |
| 629 | } |
| 630 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -608,22 +608,26 @@ | |
| 608 | case etROOT: { |
| 609 | bufpt = g.zTop ? g.zTop : ""; |
| 610 | length = (int)strlen(bufpt); |
| 611 | break; |
| 612 | } |
| 613 | case etSTRINGID: |
| 614 | case etSTRING: |
| 615 | case etDYNSTRING: { |
| 616 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 617 | bufpt = va_arg(ap,char*); |
| 618 | if( bufpt==0 ){ |
| 619 | bufpt = ""; |
| 620 | }else if( xtype==etDYNSTRING ){ |
| 621 | zExtra = bufpt; |
| 622 | }else if( xtype==etSTRINGID ){ |
| 623 | precision = 0; |
| 624 | while( bufpt[precision]>='0' && bufpt[precision]<='9' ){ |
| 625 | precision++; |
| 626 | } |
| 627 | if( bufpt[precision]!=0 ) precision++; |
| 628 | if( precision<10 ) precision=10; |
| 629 | } |
| 630 | length = StrNLen32(bufpt, limit); |
| 631 | if( precision>=0 && precision<length ) length = precision; |
| 632 | break; |
| 633 | } |
| 634 |
+52
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -1581,10 +1581,11 @@ | ||
| 1581 | 1581 | ".echo on|off Turn command echo on or off\n" |
| 1582 | 1582 | ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n" |
| 1583 | 1583 | ".exit Exit this program\n" |
| 1584 | 1584 | ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n" |
| 1585 | 1585 | " With no args, it turns EXPLAIN on.\n" |
| 1586 | + ".fullschema Show schema and the content of sqlite_stat tables\n" | |
| 1586 | 1587 | ".headers on|off Turn display of headers on or off\n" |
| 1587 | 1588 | ".help Show this message\n" |
| 1588 | 1589 | ".import FILE TABLE Import data from FILE into TABLE\n" |
| 1589 | 1590 | ".indices ?TABLE? Show names of all indices\n" |
| 1590 | 1591 | " If TABLE specified, only show indices for tables\n" |
| @@ -2409,10 +2410,61 @@ | ||
| 2409 | 2410 | p->mode = p->explainPrev.mode; |
| 2410 | 2411 | p->showHeader = p->explainPrev.showHeader; |
| 2411 | 2412 | memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); |
| 2412 | 2413 | } |
| 2413 | 2414 | }else |
| 2415 | + | |
| 2416 | + if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){ | |
| 2417 | + struct callback_data data; | |
| 2418 | + char *zErrMsg = 0; | |
| 2419 | + int doStats = 0; | |
| 2420 | + if( nArg!=1 ){ | |
| 2421 | + fprintf(stderr, "Usage: .fullschema\n"); | |
| 2422 | + rc = 1; | |
| 2423 | + goto meta_command_exit; | |
| 2424 | + } | |
| 2425 | + open_db(p, 0); | |
| 2426 | + memcpy(&data, p, sizeof(data)); | |
| 2427 | + data.showHeader = 0; | |
| 2428 | + data.mode = MODE_Semi; | |
| 2429 | + rc = sqlite3_exec(p->db, | |
| 2430 | + "SELECT sql FROM" | |
| 2431 | + " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" | |
| 2432 | + " FROM sqlite_master UNION ALL" | |
| 2433 | + " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " | |
| 2434 | + "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" | |
| 2435 | + "ORDER BY rowid", | |
| 2436 | + callback, &data, &zErrMsg | |
| 2437 | + ); | |
| 2438 | + if( rc==SQLITE_OK ){ | |
| 2439 | + sqlite3_stmt *pStmt; | |
| 2440 | + rc = sqlite3_prepare_v2(p->db, | |
| 2441 | + "SELECT rowid FROM sqlite_master" | |
| 2442 | + " WHERE name GLOB 'sqlite_stat[134]'", | |
| 2443 | + -1, &pStmt, 0); | |
| 2444 | + doStats = sqlite3_step(pStmt)==SQLITE_ROW; | |
| 2445 | + sqlite3_finalize(pStmt); | |
| 2446 | + } | |
| 2447 | + if( doStats==0 ){ | |
| 2448 | + fprintf(p->out, "/* No STAT tables available */\n"); | |
| 2449 | + }else{ | |
| 2450 | + fprintf(p->out, "ANALYZE sqlite_master;\n"); | |
| 2451 | + sqlite3_exec(p->db, "SELECT 'ANALYZE sqlite_master'", | |
| 2452 | + callback, &data, &zErrMsg); | |
| 2453 | + data.mode = MODE_Insert; | |
| 2454 | + data.zDestTable = "sqlite_stat1"; | |
| 2455 | + shell_exec(p->db, "SELECT * FROM sqlite_stat1", | |
| 2456 | + shell_callback, &data,&zErrMsg); | |
| 2457 | + data.zDestTable = "sqlite_stat3"; | |
| 2458 | + shell_exec(p->db, "SELECT * FROM sqlite_stat3", | |
| 2459 | + shell_callback, &data,&zErrMsg); | |
| 2460 | + data.zDestTable = "sqlite_stat4"; | |
| 2461 | + shell_exec(p->db, "SELECT * FROM sqlite_stat4", | |
| 2462 | + shell_callback, &data, &zErrMsg); | |
| 2463 | + fprintf(p->out, "ANALYZE sqlite_master;\n"); | |
| 2464 | + } | |
| 2465 | + }else | |
| 2414 | 2466 | |
| 2415 | 2467 | if( c=='h' && strncmp(azArg[0], "headers", n)==0 ){ |
| 2416 | 2468 | if( nArg==2 ){ |
| 2417 | 2469 | p->showHeader = booleanValue(azArg[1]); |
| 2418 | 2470 | }else{ |
| 2419 | 2471 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -1581,10 +1581,11 @@ | |
| 1581 | ".echo on|off Turn command echo on or off\n" |
| 1582 | ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n" |
| 1583 | ".exit Exit this program\n" |
| 1584 | ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n" |
| 1585 | " With no args, it turns EXPLAIN on.\n" |
| 1586 | ".headers on|off Turn display of headers on or off\n" |
| 1587 | ".help Show this message\n" |
| 1588 | ".import FILE TABLE Import data from FILE into TABLE\n" |
| 1589 | ".indices ?TABLE? Show names of all indices\n" |
| 1590 | " If TABLE specified, only show indices for tables\n" |
| @@ -2409,10 +2410,61 @@ | |
| 2409 | p->mode = p->explainPrev.mode; |
| 2410 | p->showHeader = p->explainPrev.showHeader; |
| 2411 | memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); |
| 2412 | } |
| 2413 | }else |
| 2414 | |
| 2415 | if( c=='h' && strncmp(azArg[0], "headers", n)==0 ){ |
| 2416 | if( nArg==2 ){ |
| 2417 | p->showHeader = booleanValue(azArg[1]); |
| 2418 | }else{ |
| 2419 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -1581,10 +1581,11 @@ | |
| 1581 | ".echo on|off Turn command echo on or off\n" |
| 1582 | ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n" |
| 1583 | ".exit Exit this program\n" |
| 1584 | ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n" |
| 1585 | " With no args, it turns EXPLAIN on.\n" |
| 1586 | ".fullschema Show schema and the content of sqlite_stat tables\n" |
| 1587 | ".headers on|off Turn display of headers on or off\n" |
| 1588 | ".help Show this message\n" |
| 1589 | ".import FILE TABLE Import data from FILE into TABLE\n" |
| 1590 | ".indices ?TABLE? Show names of all indices\n" |
| 1591 | " If TABLE specified, only show indices for tables\n" |
| @@ -2409,10 +2410,61 @@ | |
| 2410 | p->mode = p->explainPrev.mode; |
| 2411 | p->showHeader = p->explainPrev.showHeader; |
| 2412 | memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); |
| 2413 | } |
| 2414 | }else |
| 2415 | |
| 2416 | if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){ |
| 2417 | struct callback_data data; |
| 2418 | char *zErrMsg = 0; |
| 2419 | int doStats = 0; |
| 2420 | if( nArg!=1 ){ |
| 2421 | fprintf(stderr, "Usage: .fullschema\n"); |
| 2422 | rc = 1; |
| 2423 | goto meta_command_exit; |
| 2424 | } |
| 2425 | open_db(p, 0); |
| 2426 | memcpy(&data, p, sizeof(data)); |
| 2427 | data.showHeader = 0; |
| 2428 | data.mode = MODE_Semi; |
| 2429 | rc = sqlite3_exec(p->db, |
| 2430 | "SELECT sql FROM" |
| 2431 | " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" |
| 2432 | " FROM sqlite_master UNION ALL" |
| 2433 | " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " |
| 2434 | "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" |
| 2435 | "ORDER BY rowid", |
| 2436 | callback, &data, &zErrMsg |
| 2437 | ); |
| 2438 | if( rc==SQLITE_OK ){ |
| 2439 | sqlite3_stmt *pStmt; |
| 2440 | rc = sqlite3_prepare_v2(p->db, |
| 2441 | "SELECT rowid FROM sqlite_master" |
| 2442 | " WHERE name GLOB 'sqlite_stat[134]'", |
| 2443 | -1, &pStmt, 0); |
| 2444 | doStats = sqlite3_step(pStmt)==SQLITE_ROW; |
| 2445 | sqlite3_finalize(pStmt); |
| 2446 | } |
| 2447 | if( doStats==0 ){ |
| 2448 | fprintf(p->out, "/* No STAT tables available */\n"); |
| 2449 | }else{ |
| 2450 | fprintf(p->out, "ANALYZE sqlite_master;\n"); |
| 2451 | sqlite3_exec(p->db, "SELECT 'ANALYZE sqlite_master'", |
| 2452 | callback, &data, &zErrMsg); |
| 2453 | data.mode = MODE_Insert; |
| 2454 | data.zDestTable = "sqlite_stat1"; |
| 2455 | shell_exec(p->db, "SELECT * FROM sqlite_stat1", |
| 2456 | shell_callback, &data,&zErrMsg); |
| 2457 | data.zDestTable = "sqlite_stat3"; |
| 2458 | shell_exec(p->db, "SELECT * FROM sqlite_stat3", |
| 2459 | shell_callback, &data,&zErrMsg); |
| 2460 | data.zDestTable = "sqlite_stat4"; |
| 2461 | shell_exec(p->db, "SELECT * FROM sqlite_stat4", |
| 2462 | shell_callback, &data, &zErrMsg); |
| 2463 | fprintf(p->out, "ANALYZE sqlite_master;\n"); |
| 2464 | } |
| 2465 | }else |
| 2466 | |
| 2467 | if( c=='h' && strncmp(azArg[0], "headers", n)==0 ){ |
| 2468 | if( nArg==2 ){ |
| 2469 | p->showHeader = booleanValue(azArg[1]); |
| 2470 | }else{ |
| 2471 |
+505
-237
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | -** version 3.8.5. By combining all the individual C code files into this | |
| 3 | +** version 3.8.6. By combining all the individual C code files into this | |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | ||
| 220 | 220 | ** |
| 221 | 221 | ** See also: [sqlite3_libversion()], |
| 222 | 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | 224 | */ |
| 225 | -#define SQLITE_VERSION "3.8.5" | |
| 226 | -#define SQLITE_VERSION_NUMBER 3008005 | |
| 227 | -#define SQLITE_SOURCE_ID "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212" | |
| 225 | +#define SQLITE_VERSION "3.8.6" | |
| 226 | +#define SQLITE_VERSION_NUMBER 3008006 | |
| 227 | +#define SQLITE_SOURCE_ID "2014-07-01 11:54:02 21981e35062cc6b30e9576786cbf55265a7a4d41" | |
| 228 | 228 | |
| 229 | 229 | /* |
| 230 | 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | 232 | ** |
| @@ -9479,10 +9479,11 @@ | ||
| 9479 | 9479 | SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8); |
| 9480 | 9480 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 9481 | 9481 | #ifndef SQLITE_OMIT_TRACE |
| 9482 | 9482 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 9483 | 9483 | #endif |
| 9484 | +SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); | |
| 9484 | 9485 | |
| 9485 | 9486 | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); |
| 9486 | 9487 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*,int); |
| 9487 | 9488 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); |
| 9488 | 9489 | |
| @@ -12885,11 +12886,13 @@ | ||
| 12885 | 12886 | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); |
| 12886 | 12887 | |
| 12887 | 12888 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 12888 | 12889 | SQLITE_PRIVATE void sqlite3AnalyzeFunctions(void); |
| 12889 | 12890 | SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(Parse*,Index*,UnpackedRecord**,Expr*,u8,int,int*); |
| 12891 | +SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr(Parse*, Expr*, u8, sqlite3_value**); | |
| 12890 | 12892 | SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord*); |
| 12893 | +SQLITE_PRIVATE int sqlite3Stat4Column(sqlite3*, const void*, int, int, sqlite3_value**); | |
| 12891 | 12894 | #endif |
| 12892 | 12895 | |
| 12893 | 12896 | /* |
| 12894 | 12897 | ** The interface to the LEMON-generated parser |
| 12895 | 12898 | */ |
| @@ -14199,11 +14202,10 @@ | ||
| 14199 | 14202 | SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe*, int, int); |
| 14200 | 14203 | |
| 14201 | 14204 | int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); |
| 14202 | 14205 | SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); |
| 14203 | 14206 | SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); |
| 14204 | -SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); | |
| 14205 | 14207 | SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); |
| 14206 | 14208 | SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); |
| 14207 | 14209 | SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); |
| 14208 | 14210 | SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int); |
| 14209 | 14211 | SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*); |
| @@ -21562,12 +21564,12 @@ | ||
| 21562 | 21564 | ** * Bytes in the range of 0x80 through 0xbf which occur as the first |
| 21563 | 21565 | ** byte of a character are interpreted as single-byte characters |
| 21564 | 21566 | ** and rendered as themselves even though they are technically |
| 21565 | 21567 | ** invalid characters. |
| 21566 | 21568 | ** |
| 21567 | -** * This routine accepts an infinite number of different UTF8 encodings | |
| 21568 | -** for unicode values 0x80 and greater. It do not change over-length | |
| 21569 | +** * This routine accepts over-length UTF8 encodings | |
| 21570 | +** for unicode values 0x80 and greater. It does not change over-length | |
| 21569 | 21571 | ** encodings to 0xfffd as some systems recommend. |
| 21570 | 21572 | */ |
| 21571 | 21573 | #define READ_UTF8(zIn, zTerm, c) \ |
| 21572 | 21574 | c = *(zIn++); \ |
| 21573 | 21575 | if( c>=0xc0 ){ \ |
| @@ -24371,14 +24373,14 @@ | ||
| 24371 | 24373 | { "mremap", (sqlite3_syscall_ptr)mremap, 0 }, |
| 24372 | 24374 | #else |
| 24373 | 24375 | { "mremap", (sqlite3_syscall_ptr)0, 0 }, |
| 24374 | 24376 | #endif |
| 24375 | 24377 | #define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent) |
| 24376 | -#endif | |
| 24377 | - | |
| 24378 | 24378 | { "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 }, |
| 24379 | 24379 | #define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent) |
| 24380 | + | |
| 24381 | +#endif | |
| 24380 | 24382 | |
| 24381 | 24383 | }; /* End of the overrideable system calls */ |
| 24382 | 24384 | |
| 24383 | 24385 | /* |
| 24384 | 24386 | ** This is the xSetSystemCall() method of sqlite3_vfs for all of the |
| @@ -25844,10 +25846,17 @@ | ||
| 25844 | 25846 | osUnlink(pFile->pId->zCanonicalName); |
| 25845 | 25847 | } |
| 25846 | 25848 | vxworksReleaseFileId(pFile->pId); |
| 25847 | 25849 | pFile->pId = 0; |
| 25848 | 25850 | } |
| 25851 | +#endif | |
| 25852 | +#ifdef SQLITE_UNLINK_AFTER_CLOSE | |
| 25853 | + if( pFile->ctrlFlags & UNIXFILE_DELETE ){ | |
| 25854 | + osUnlink(pFile->zPath); | |
| 25855 | + sqlite3_free(*(char**)&pFile->zPath); | |
| 25856 | + pFile->zPath = 0; | |
| 25857 | + } | |
| 25849 | 25858 | #endif |
| 25850 | 25859 | OSTRACE(("CLOSE %-3d\n", pFile->h)); |
| 25851 | 25860 | OpenCounter(-1); |
| 25852 | 25861 | sqlite3_free(pFile->pUnused); |
| 25853 | 25862 | memset(pFile, 0, sizeof(unixFile)); |
| @@ -27883,12 +27892,29 @@ | ||
| 27883 | 27892 | rc |= SQLITE_IOCAP_POWERSAFE_OVERWRITE; |
| 27884 | 27893 | } |
| 27885 | 27894 | return rc; |
| 27886 | 27895 | } |
| 27887 | 27896 | |
| 27897 | +#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 | |
| 27898 | + | |
| 27899 | +/* | |
| 27900 | +** Return the system page size. | |
| 27901 | +** | |
| 27902 | +** This function should not be called directly by other code in this file. | |
| 27903 | +** Instead, it should be called via macro osGetpagesize(). | |
| 27904 | +*/ | |
| 27905 | +static int unixGetpagesize(void){ | |
| 27906 | +#if defined(_BSD_SOURCE) | |
| 27907 | + return getpagesize(); | |
| 27908 | +#else | |
| 27909 | + return (int)sysconf(_SC_PAGESIZE); | |
| 27910 | +#endif | |
| 27911 | +} | |
| 27912 | + | |
| 27913 | +#endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */ | |
| 27914 | + | |
| 27888 | 27915 | #ifndef SQLITE_OMIT_WAL |
| 27889 | - | |
| 27890 | 27916 | |
| 27891 | 27917 | /* |
| 27892 | 27918 | ** Object used to represent an shared memory buffer. |
| 27893 | 27919 | ** |
| 27894 | 27920 | ** When multiple threads all reference the same wal-index, each thread |
| @@ -28035,24 +28061,10 @@ | ||
| 28035 | 28061 | #endif |
| 28036 | 28062 | |
| 28037 | 28063 | return rc; |
| 28038 | 28064 | } |
| 28039 | 28065 | |
| 28040 | -/* | |
| 28041 | -** Return the system page size. | |
| 28042 | -** | |
| 28043 | -** This function should not be called directly by other code in this file. | |
| 28044 | -** Instead, it should be called via macro osGetpagesize(). | |
| 28045 | -*/ | |
| 28046 | -static int unixGetpagesize(void){ | |
| 28047 | -#if defined(_BSD_SOURCE) | |
| 28048 | - return getpagesize(); | |
| 28049 | -#else | |
| 28050 | - return (int)sysconf(_SC_PAGESIZE); | |
| 28051 | -#endif | |
| 28052 | -} | |
| 28053 | - | |
| 28054 | 28066 | /* |
| 28055 | 28067 | ** Return the minimum number of 32KB shm regions that should be mapped at |
| 28056 | 28068 | ** a time, assuming that each mapping must be an integer multiple of the |
| 28057 | 28069 | ** current system page-size. |
| 28058 | 28070 | ** |
| @@ -29698,10 +29710,16 @@ | ||
| 29698 | 29710 | } |
| 29699 | 29711 | |
| 29700 | 29712 | if( isDelete ){ |
| 29701 | 29713 | #if OS_VXWORKS |
| 29702 | 29714 | zPath = zName; |
| 29715 | +#elif defined(SQLITE_UNLINK_AFTER_CLOSE) | |
| 29716 | + zPath = sqlite3_mprintf("%s", zName); | |
| 29717 | + if( zPath==0 ){ | |
| 29718 | + robust_close(p, fd, __LINE__); | |
| 29719 | + return SQLITE_NOMEM; | |
| 29720 | + } | |
| 29703 | 29721 | #else |
| 29704 | 29722 | osUnlink(zName); |
| 29705 | 29723 | #endif |
| 29706 | 29724 | } |
| 29707 | 29725 | #if SQLITE_ENABLE_LOCKING_STYLE |
| @@ -49189,20 +49207,20 @@ | ||
| 49189 | 49207 | ** |
| 49190 | 49208 | ** After 5 RETRYs, we begin calling sqlite3OsSleep(). The first few |
| 49191 | 49209 | ** calls to sqlite3OsSleep() have a delay of 1 microsecond. Really this |
| 49192 | 49210 | ** is more of a scheduler yield than an actual delay. But on the 10th |
| 49193 | 49211 | ** an subsequent retries, the delays start becoming longer and longer, |
| 49194 | - ** so that on the 100th (and last) RETRY we delay for 21 milliseconds. | |
| 49195 | - ** The total delay time before giving up is less than 1 second. | |
| 49212 | + ** so that on the 100th (and last) RETRY we delay for 323 milliseconds. | |
| 49213 | + ** The total delay time before giving up is less than 10 seconds. | |
| 49196 | 49214 | */ |
| 49197 | 49215 | if( cnt>5 ){ |
| 49198 | 49216 | int nDelay = 1; /* Pause time in microseconds */ |
| 49199 | 49217 | if( cnt>100 ){ |
| 49200 | 49218 | VVA_ONLY( pWal->lockError = 1; ) |
| 49201 | 49219 | return SQLITE_PROTOCOL; |
| 49202 | 49220 | } |
| 49203 | - if( cnt>=10 ) nDelay = (cnt-9)*238; /* Max delay 21ms. Total delay 996ms */ | |
| 49221 | + if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39; | |
| 49204 | 49222 | sqlite3OsSleep(pWal->pVfs, nDelay); |
| 49205 | 49223 | } |
| 49206 | 49224 | |
| 49207 | 49225 | if( !useWal ){ |
| 49208 | 49226 | rc = walIndexReadHdr(pWal, pChanged); |
| @@ -61582,10 +61600,72 @@ | ||
| 61582 | 61600 | FuncDef *aFunc = (FuncDef*)&GLOBAL(FuncDef, aAnalyzeTableFuncs); |
| 61583 | 61601 | for(i=0; i<ArraySize(aAnalyzeTableFuncs); i++){ |
| 61584 | 61602 | sqlite3FuncDefInsert(pHash, &aFunc[i]); |
| 61585 | 61603 | } |
| 61586 | 61604 | } |
| 61605 | + | |
| 61606 | +/* | |
| 61607 | +** Attempt to extract a value from pExpr and use it to construct *ppVal. | |
| 61608 | +** | |
| 61609 | +** If pAlloc is not NULL, then an UnpackedRecord object is created for | |
| 61610 | +** pAlloc if one does not exist and the new value is added to the | |
| 61611 | +** UnpackedRecord object. | |
| 61612 | +** | |
| 61613 | +** A value is extracted in the following cases: | |
| 61614 | +** | |
| 61615 | +** * (pExpr==0). In this case the value is assumed to be an SQL NULL, | |
| 61616 | +** | |
| 61617 | +** * The expression is a bound variable, and this is a reprepare, or | |
| 61618 | +** | |
| 61619 | +** * The expression is a literal value. | |
| 61620 | +** | |
| 61621 | +** On success, *ppVal is made to point to the extracted value. The caller | |
| 61622 | +** is responsible for ensuring that the value is eventually freed. | |
| 61623 | +*/ | |
| 61624 | +static int stat4ValueFromExpr( | |
| 61625 | + Parse *pParse, /* Parse context */ | |
| 61626 | + Expr *pExpr, /* The expression to extract a value from */ | |
| 61627 | + u8 affinity, /* Affinity to use */ | |
| 61628 | + struct ValueNewStat4Ctx *pAlloc,/* How to allocate space. Or NULL */ | |
| 61629 | + sqlite3_value **ppVal /* OUT: New value object (or NULL) */ | |
| 61630 | +){ | |
| 61631 | + int rc = SQLITE_OK; | |
| 61632 | + sqlite3_value *pVal = 0; | |
| 61633 | + sqlite3 *db = pParse->db; | |
| 61634 | + | |
| 61635 | + /* Skip over any TK_COLLATE nodes */ | |
| 61636 | + pExpr = sqlite3ExprSkipCollate(pExpr); | |
| 61637 | + | |
| 61638 | + if( !pExpr ){ | |
| 61639 | + pVal = valueNew(db, pAlloc); | |
| 61640 | + if( pVal ){ | |
| 61641 | + sqlite3VdbeMemSetNull((Mem*)pVal); | |
| 61642 | + } | |
| 61643 | + }else if( pExpr->op==TK_VARIABLE | |
| 61644 | + || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE) | |
| 61645 | + ){ | |
| 61646 | + Vdbe *v; | |
| 61647 | + int iBindVar = pExpr->iColumn; | |
| 61648 | + sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar); | |
| 61649 | + if( (v = pParse->pReprepare)!=0 ){ | |
| 61650 | + pVal = valueNew(db, pAlloc); | |
| 61651 | + if( pVal ){ | |
| 61652 | + rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]); | |
| 61653 | + if( rc==SQLITE_OK ){ | |
| 61654 | + sqlite3ValueApplyAffinity(pVal, affinity, ENC(db)); | |
| 61655 | + } | |
| 61656 | + pVal->db = pParse->db; | |
| 61657 | + } | |
| 61658 | + } | |
| 61659 | + }else{ | |
| 61660 | + rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc); | |
| 61661 | + } | |
| 61662 | + | |
| 61663 | + assert( pVal==0 || pVal->db==db ); | |
| 61664 | + *ppVal = pVal; | |
| 61665 | + return rc; | |
| 61666 | +} | |
| 61587 | 61667 | |
| 61588 | 61668 | /* |
| 61589 | 61669 | ** This function is used to allocate and populate UnpackedRecord |
| 61590 | 61670 | ** structures intended to be compared against sample index keys stored |
| 61591 | 61671 | ** in the sqlite_stat4 table. |
| @@ -61622,52 +61702,90 @@ | ||
| 61622 | 61702 | Expr *pExpr, /* The expression to extract a value from */ |
| 61623 | 61703 | u8 affinity, /* Affinity to use */ |
| 61624 | 61704 | int iVal, /* Array element to populate */ |
| 61625 | 61705 | int *pbOk /* OUT: True if value was extracted */ |
| 61626 | 61706 | ){ |
| 61627 | - int rc = SQLITE_OK; | |
| 61707 | + int rc; | |
| 61628 | 61708 | sqlite3_value *pVal = 0; |
| 61629 | - sqlite3 *db = pParse->db; | |
| 61630 | - | |
| 61631 | - | |
| 61632 | 61709 | struct ValueNewStat4Ctx alloc; |
| 61710 | + | |
| 61633 | 61711 | alloc.pParse = pParse; |
| 61634 | 61712 | alloc.pIdx = pIdx; |
| 61635 | 61713 | alloc.ppRec = ppRec; |
| 61636 | 61714 | alloc.iVal = iVal; |
| 61637 | 61715 | |
| 61638 | - /* Skip over any TK_COLLATE nodes */ | |
| 61639 | - pExpr = sqlite3ExprSkipCollate(pExpr); | |
| 61640 | - | |
| 61641 | - if( !pExpr ){ | |
| 61642 | - pVal = valueNew(db, &alloc); | |
| 61643 | - if( pVal ){ | |
| 61644 | - sqlite3VdbeMemSetNull((Mem*)pVal); | |
| 61645 | - } | |
| 61646 | - }else if( pExpr->op==TK_VARIABLE | |
| 61647 | - || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE) | |
| 61648 | - ){ | |
| 61649 | - Vdbe *v; | |
| 61650 | - int iBindVar = pExpr->iColumn; | |
| 61651 | - sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar); | |
| 61652 | - if( (v = pParse->pReprepare)!=0 ){ | |
| 61653 | - pVal = valueNew(db, &alloc); | |
| 61654 | - if( pVal ){ | |
| 61655 | - rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]); | |
| 61656 | - if( rc==SQLITE_OK ){ | |
| 61657 | - sqlite3ValueApplyAffinity(pVal, affinity, ENC(db)); | |
| 61658 | - } | |
| 61659 | - pVal->db = pParse->db; | |
| 61660 | - } | |
| 61661 | - } | |
| 61662 | - }else{ | |
| 61663 | - rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, &alloc); | |
| 61664 | - } | |
| 61716 | + rc = stat4ValueFromExpr(pParse, pExpr, affinity, &alloc, &pVal); | |
| 61717 | + assert( pVal==0 || pVal->db==pParse->db ); | |
| 61665 | 61718 | *pbOk = (pVal!=0); |
| 61719 | + return rc; | |
| 61720 | +} | |
| 61666 | 61721 | |
| 61667 | - assert( pVal==0 || pVal->db==db ); | |
| 61668 | - return rc; | |
| 61722 | +/* | |
| 61723 | +** Attempt to extract a value from expression pExpr using the methods | |
| 61724 | +** as described for sqlite3Stat4ProbeSetValue() above. | |
| 61725 | +** | |
| 61726 | +** If successful, set *ppVal to point to a new value object and return | |
| 61727 | +** SQLITE_OK. If no value can be extracted, but no other error occurs | |
| 61728 | +** (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error | |
| 61729 | +** does occur, return an SQLite error code. The final value of *ppVal | |
| 61730 | +** is undefined in this case. | |
| 61731 | +*/ | |
| 61732 | +SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr( | |
| 61733 | + Parse *pParse, /* Parse context */ | |
| 61734 | + Expr *pExpr, /* The expression to extract a value from */ | |
| 61735 | + u8 affinity, /* Affinity to use */ | |
| 61736 | + sqlite3_value **ppVal /* OUT: New value object (or NULL) */ | |
| 61737 | +){ | |
| 61738 | + return stat4ValueFromExpr(pParse, pExpr, affinity, 0, ppVal); | |
| 61739 | +} | |
| 61740 | + | |
| 61741 | +/* | |
| 61742 | +** Extract the iCol-th column from the nRec-byte record in pRec. Write | |
| 61743 | +** the column value into *ppVal. If *ppVal is initially NULL then a new | |
| 61744 | +** sqlite3_value object is allocated. | |
| 61745 | +** | |
| 61746 | +** If *ppVal is initially NULL then the caller is responsible for | |
| 61747 | +** ensuring that the value written into *ppVal is eventually freed. | |
| 61748 | +*/ | |
| 61749 | +SQLITE_PRIVATE int sqlite3Stat4Column( | |
| 61750 | + sqlite3 *db, /* Database handle */ | |
| 61751 | + const void *pRec, /* Pointer to buffer containing record */ | |
| 61752 | + int nRec, /* Size of buffer pRec in bytes */ | |
| 61753 | + int iCol, /* Column to extract */ | |
| 61754 | + sqlite3_value **ppVal /* OUT: Extracted value */ | |
| 61755 | +){ | |
| 61756 | + u32 t; /* a column type code */ | |
| 61757 | + int nHdr; /* Size of the header in the record */ | |
| 61758 | + int iHdr; /* Next unread header byte */ | |
| 61759 | + int iField; /* Next unread data byte */ | |
| 61760 | + int szField; /* Size of the current data field */ | |
| 61761 | + int i; /* Column index */ | |
| 61762 | + u8 *a = (u8*)pRec; /* Typecast byte array */ | |
| 61763 | + Mem *pMem = *ppVal; /* Write result into this Mem object */ | |
| 61764 | + | |
| 61765 | + assert( iCol>0 ); | |
| 61766 | + iHdr = getVarint32(a, nHdr); | |
| 61767 | + if( nHdr>nRec || iHdr>=nHdr ) return SQLITE_CORRUPT_BKPT; | |
| 61768 | + iField = nHdr; | |
| 61769 | + for(i=0; i<=iCol; i++){ | |
| 61770 | + iHdr += getVarint32(&a[iHdr], t); | |
| 61771 | + testcase( iHdr==nHdr ); | |
| 61772 | + testcase( iHdr==nHdr+1 ); | |
| 61773 | + if( iHdr>nHdr ) return SQLITE_CORRUPT_BKPT; | |
| 61774 | + szField = sqlite3VdbeSerialTypeLen(t); | |
| 61775 | + iField += szField; | |
| 61776 | + } | |
| 61777 | + testcase( iField==nRec ); | |
| 61778 | + testcase( iField==nRec+1 ); | |
| 61779 | + if( iField>nRec ) return SQLITE_CORRUPT_BKPT; | |
| 61780 | + if( pMem==0 ){ | |
| 61781 | + pMem = *ppVal = sqlite3ValueNew(db); | |
| 61782 | + if( pMem==0 ) return SQLITE_NOMEM; | |
| 61783 | + } | |
| 61784 | + sqlite3VdbeSerialGet(&a[iField-szField], t, pMem); | |
| 61785 | + pMem->enc = ENC(db); | |
| 61786 | + return SQLITE_OK; | |
| 61669 | 61787 | } |
| 61670 | 61788 | |
| 61671 | 61789 | /* |
| 61672 | 61790 | ** Unless it is NULL, the argument must be an UnpackedRecord object returned |
| 61673 | 61791 | ** by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes |
| @@ -65315,10 +65433,11 @@ | ||
| 65315 | 65433 | /* rc==0 here means that one or both of the keys ran out of fields and |
| 65316 | 65434 | ** all the fields up to that point were equal. Return the the default_rc |
| 65317 | 65435 | ** value. */ |
| 65318 | 65436 | assert( CORRUPT_DB |
| 65319 | 65437 | || pPKey2->default_rc==vdbeRecordCompareDebug(nKey1, pKey1, pPKey2) |
| 65438 | + || pKeyInfo->db->mallocFailed | |
| 65320 | 65439 | ); |
| 65321 | 65440 | return pPKey2->default_rc; |
| 65322 | 65441 | } |
| 65323 | 65442 | |
| 65324 | 65443 | /* |
| @@ -65480,10 +65599,11 @@ | ||
| 65480 | 65599 | |
| 65481 | 65600 | assert( (res==0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)==0) |
| 65482 | 65601 | || (res<0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)<0) |
| 65483 | 65602 | || (res>0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)>0) |
| 65484 | 65603 | || CORRUPT_DB |
| 65604 | + || pPKey2->pKeyInfo->db->mallocFailed | |
| 65485 | 65605 | ); |
| 65486 | 65606 | return res; |
| 65487 | 65607 | } |
| 65488 | 65608 | |
| 65489 | 65609 | /* |
| @@ -76853,11 +76973,12 @@ | ||
| 76853 | 76973 | }else{ |
| 76854 | 76974 | /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to |
| 76855 | 76975 | ** likelihood(X, 0.0625). |
| 76856 | 76976 | ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for |
| 76857 | 76977 | ** likelihood(X,0.0625). */ |
| 76858 | - pExpr->iTable = 62; /* TUNING: Default 2nd arg to unlikely() is 0.0625 */ | |
| 76978 | + /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */ | |
| 76979 | + pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938; | |
| 76859 | 76980 | } |
| 76860 | 76981 | } |
| 76861 | 76982 | } |
| 76862 | 76983 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 76863 | 76984 | if( pDef ){ |
| @@ -77629,11 +77750,11 @@ | ||
| 77629 | 77750 | ** SELECT * FROM t1 WHERE (select a from t1); |
| 77630 | 77751 | */ |
| 77631 | 77752 | SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ |
| 77632 | 77753 | int op; |
| 77633 | 77754 | pExpr = sqlite3ExprSkipCollate(pExpr); |
| 77634 | - if( pExpr->flags & EP_Generic ) return SQLITE_AFF_NONE; | |
| 77755 | + if( pExpr->flags & EP_Generic ) return 0; | |
| 77635 | 77756 | op = pExpr->op; |
| 77636 | 77757 | if( op==TK_SELECT ){ |
| 77637 | 77758 | assert( pExpr->flags&EP_xIsSelect ); |
| 77638 | 77759 | return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); |
| 77639 | 77760 | } |
| @@ -82929,10 +83050,11 @@ | ||
| 82929 | 83050 | /* Open the sqlite_stat[134] tables for writing. */ |
| 82930 | 83051 | for(i=0; aTable[i].zCols; i++){ |
| 82931 | 83052 | assert( i<ArraySize(aTable) ); |
| 82932 | 83053 | sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3); |
| 82933 | 83054 | sqlite3VdbeChangeP5(v, aCreateTbl[i]); |
| 83055 | + VdbeComment((v, aTable[i].zName)); | |
| 82934 | 83056 | } |
| 82935 | 83057 | } |
| 82936 | 83058 | |
| 82937 | 83059 | /* |
| 82938 | 83060 | ** Recommended number of samples for sqlite_stat4 |
| @@ -82964,11 +83086,12 @@ | ||
| 82964 | 83086 | #endif |
| 82965 | 83087 | }; |
| 82966 | 83088 | struct Stat4Accum { |
| 82967 | 83089 | tRowcnt nRow; /* Number of rows in the entire table */ |
| 82968 | 83090 | tRowcnt nPSample; /* How often to do a periodic sample */ |
| 82969 | - int nCol; /* Number of columns in index + rowid */ | |
| 83091 | + int nCol; /* Number of columns in index + pk/rowid */ | |
| 83092 | + int nKeyCol; /* Number of index columns w/o the pk/rowid */ | |
| 82970 | 83093 | int mxSample; /* Maximum number of samples to accumulate */ |
| 82971 | 83094 | Stat4Sample current; /* Current row as a Stat4Sample */ |
| 82972 | 83095 | u32 iPrn; /* Pseudo-random number used for sampling */ |
| 82973 | 83096 | Stat4Sample *aBest; /* Array of nCol best samples */ |
| 82974 | 83097 | int iMin; /* Index in a[] of entry with minimum score */ |
| @@ -83050,13 +83173,21 @@ | ||
| 83050 | 83173 | #endif |
| 83051 | 83174 | sqlite3DbFree(p->db, p); |
| 83052 | 83175 | } |
| 83053 | 83176 | |
| 83054 | 83177 | /* |
| 83055 | -** Implementation of the stat_init(N,C) SQL function. The two parameters | |
| 83056 | -** are the number of rows in the table or index (C) and the number of columns | |
| 83057 | -** in the index (N). The second argument (C) is only used for STAT3 and STAT4. | |
| 83178 | +** Implementation of the stat_init(N,K,C) SQL function. The three parameters | |
| 83179 | +** are: | |
| 83180 | +** N: The number of columns in the index including the rowid/pk | |
| 83181 | +** K: The number of columns in the index excluding the rowid/pk | |
| 83182 | +** C: The number of rows in the index | |
| 83183 | +** | |
| 83184 | +** C is only used for STAT3 and STAT4. | |
| 83185 | +** | |
| 83186 | +** For ordinary rowid tables, N==K+1. But for WITHOUT ROWID tables, | |
| 83187 | +** N=K+P where P is the number of columns in the primary key. For the | |
| 83188 | +** covering index that implements the original WITHOUT ROWID table, N==K. | |
| 83058 | 83189 | ** |
| 83059 | 83190 | ** This routine allocates the Stat4Accum object in heap memory. The return |
| 83060 | 83191 | ** value is a pointer to the the Stat4Accum object encoded as a blob (i.e. |
| 83061 | 83192 | ** the size of the blob is sizeof(void*) bytes). |
| 83062 | 83193 | */ |
| @@ -83065,10 +83196,11 @@ | ||
| 83065 | 83196 | int argc, |
| 83066 | 83197 | sqlite3_value **argv |
| 83067 | 83198 | ){ |
| 83068 | 83199 | Stat4Accum *p; |
| 83069 | 83200 | int nCol; /* Number of columns in index being sampled */ |
| 83201 | + int nKeyCol; /* Number of key columns */ | |
| 83070 | 83202 | int nColUp; /* nCol rounded up for alignment */ |
| 83071 | 83203 | int n; /* Bytes of space to allocate */ |
| 83072 | 83204 | sqlite3 *db; /* Database connection */ |
| 83073 | 83205 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83074 | 83206 | int mxSample = SQLITE_STAT4_SAMPLES; |
| @@ -83075,12 +83207,15 @@ | ||
| 83075 | 83207 | #endif |
| 83076 | 83208 | |
| 83077 | 83209 | /* Decode the three function arguments */ |
| 83078 | 83210 | UNUSED_PARAMETER(argc); |
| 83079 | 83211 | nCol = sqlite3_value_int(argv[0]); |
| 83080 | - assert( nCol>1 ); /* >1 because it includes the rowid column */ | |
| 83212 | + assert( nCol>0 ); | |
| 83081 | 83213 | nColUp = sizeof(tRowcnt)<8 ? (nCol+1)&~1 : nCol; |
| 83214 | + nKeyCol = sqlite3_value_int(argv[1]); | |
| 83215 | + assert( nKeyCol<=nCol ); | |
| 83216 | + assert( nKeyCol>0 ); | |
| 83082 | 83217 | |
| 83083 | 83218 | /* Allocate the space required for the Stat4Accum object */ |
| 83084 | 83219 | n = sizeof(*p) |
| 83085 | 83220 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ |
| 83086 | 83221 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ |
| @@ -83098,10 +83233,11 @@ | ||
| 83098 | 83233 | } |
| 83099 | 83234 | |
| 83100 | 83235 | p->db = db; |
| 83101 | 83236 | p->nRow = 0; |
| 83102 | 83237 | p->nCol = nCol; |
| 83238 | + p->nKeyCol = nKeyCol; | |
| 83103 | 83239 | p->current.anDLt = (tRowcnt*)&p[1]; |
| 83104 | 83240 | p->current.anEq = &p->current.anDLt[nColUp]; |
| 83105 | 83241 | |
| 83106 | 83242 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83107 | 83243 | { |
| @@ -83108,13 +83244,13 @@ | ||
| 83108 | 83244 | u8 *pSpace; /* Allocated space not yet assigned */ |
| 83109 | 83245 | int i; /* Used to iterate through p->aSample[] */ |
| 83110 | 83246 | |
| 83111 | 83247 | p->iGet = -1; |
| 83112 | 83248 | p->mxSample = mxSample; |
| 83113 | - p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[1])/(mxSample/3+1) + 1); | |
| 83249 | + p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); | |
| 83114 | 83250 | p->current.anLt = &p->current.anEq[nColUp]; |
| 83115 | - p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[1])*0xd0944565; | |
| 83251 | + p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565; | |
| 83116 | 83252 | |
| 83117 | 83253 | /* Set up the Stat4Accum.a[] and aBest[] arrays */ |
| 83118 | 83254 | p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; |
| 83119 | 83255 | p->aBest = &p->a[mxSample]; |
| 83120 | 83256 | pSpace = (u8*)(&p->a[mxSample+nCol]); |
| @@ -83133,11 +83269,11 @@ | ||
| 83133 | 83269 | |
| 83134 | 83270 | /* Return a pointer to the allocated object to the caller */ |
| 83135 | 83271 | sqlite3_result_blob(context, p, sizeof(p), stat4Destructor); |
| 83136 | 83272 | } |
| 83137 | 83273 | static const FuncDef statInitFuncdef = { |
| 83138 | - 1+IsStat34, /* nArg */ | |
| 83274 | + 2+IsStat34, /* nArg */ | |
| 83139 | 83275 | SQLITE_UTF8, /* funcFlags */ |
| 83140 | 83276 | 0, /* pUserData */ |
| 83141 | 83277 | 0, /* pNext */ |
| 83142 | 83278 | statInit, /* xFunc */ |
| 83143 | 83279 | 0, /* xStep */ |
| @@ -83374,11 +83510,11 @@ | ||
| 83374 | 83510 | Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]); |
| 83375 | 83511 | int iChng = sqlite3_value_int(argv[1]); |
| 83376 | 83512 | |
| 83377 | 83513 | UNUSED_PARAMETER( argc ); |
| 83378 | 83514 | UNUSED_PARAMETER( context ); |
| 83379 | - assert( p->nCol>1 ); /* Includes rowid field */ | |
| 83515 | + assert( p->nCol>0 ); | |
| 83380 | 83516 | assert( iChng<p->nCol ); |
| 83381 | 83517 | |
| 83382 | 83518 | if( p->nRow==0 ){ |
| 83383 | 83519 | /* This is the first call to this function. Do initialization. */ |
| 83384 | 83520 | for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1; |
| @@ -83502,19 +83638,19 @@ | ||
| 83502 | 83638 | ** I = (K+D-1)/D |
| 83503 | 83639 | */ |
| 83504 | 83640 | char *z; |
| 83505 | 83641 | int i; |
| 83506 | 83642 | |
| 83507 | - char *zRet = sqlite3MallocZero(p->nCol * 25); | |
| 83643 | + char *zRet = sqlite3MallocZero( (p->nKeyCol+1)*25 ); | |
| 83508 | 83644 | if( zRet==0 ){ |
| 83509 | 83645 | sqlite3_result_error_nomem(context); |
| 83510 | 83646 | return; |
| 83511 | 83647 | } |
| 83512 | 83648 | |
| 83513 | 83649 | sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow); |
| 83514 | 83650 | z = zRet + sqlite3Strlen30(zRet); |
| 83515 | - for(i=0; i<(p->nCol-1); i++){ | |
| 83651 | + for(i=0; i<p->nKeyCol; i++){ | |
| 83516 | 83652 | u64 nDistinct = p->current.anDLt[i] + 1; |
| 83517 | 83653 | u64 iVal = (p->nRow + nDistinct - 1) / nDistinct; |
| 83518 | 83654 | sqlite3_snprintf(24, z, " %llu", iVal); |
| 83519 | 83655 | z += sqlite3Strlen30(z); |
| 83520 | 83656 | assert( p->current.anEq[i] ); |
| @@ -83679,22 +83815,23 @@ | ||
| 83679 | 83815 | int addrNextRow; /* Address of "next_row:" */ |
| 83680 | 83816 | const char *zIdxName; /* Name of the index */ |
| 83681 | 83817 | |
| 83682 | 83818 | if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
| 83683 | 83819 | if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0; |
| 83684 | - VdbeNoopComment((v, "Begin analysis of %s", pIdx->zName)); | |
| 83685 | - nCol = pIdx->nKeyCol; | |
| 83820 | + if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ | |
| 83821 | + nCol = pIdx->nKeyCol; | |
| 83822 | + zIdxName = pTab->zName; | |
| 83823 | + }else{ | |
| 83824 | + nCol = pIdx->nColumn; | |
| 83825 | + zIdxName = pIdx->zName; | |
| 83826 | + } | |
| 83686 | 83827 | aGotoChng = sqlite3DbMallocRaw(db, sizeof(int)*(nCol+1)); |
| 83687 | 83828 | if( aGotoChng==0 ) continue; |
| 83688 | 83829 | |
| 83689 | 83830 | /* Populate the register containing the index name. */ |
| 83690 | - if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ | |
| 83691 | - zIdxName = pTab->zName; | |
| 83692 | - }else{ | |
| 83693 | - zIdxName = pIdx->zName; | |
| 83694 | - } | |
| 83695 | 83831 | sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, zIdxName, 0); |
| 83832 | + VdbeComment((v, "Analysis for %s.%s", pTab->zName, zIdxName)); | |
| 83696 | 83833 | |
| 83697 | 83834 | /* |
| 83698 | 83835 | ** Pseudo-code for loop that calls stat_push(): |
| 83699 | 83836 | ** |
| 83700 | 83837 | ** Rewind csr |
| @@ -83744,16 +83881,17 @@ | ||
| 83744 | 83881 | ** (2) the number of rows in the index, |
| 83745 | 83882 | ** |
| 83746 | 83883 | ** The second argument is only used for STAT3 and STAT4 |
| 83747 | 83884 | */ |
| 83748 | 83885 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83749 | - sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+2); | |
| 83886 | + sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3); | |
| 83750 | 83887 | #endif |
| 83751 | - sqlite3VdbeAddOp2(v, OP_Integer, nCol+1, regStat4+1); | |
| 83888 | + sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1); | |
| 83889 | + sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2); | |
| 83752 | 83890 | sqlite3VdbeAddOp3(v, OP_Function, 0, regStat4+1, regStat4); |
| 83753 | 83891 | sqlite3VdbeChangeP4(v, -1, (char*)&statInitFuncdef, P4_FUNCDEF); |
| 83754 | - sqlite3VdbeChangeP5(v, 1+IsStat34); | |
| 83892 | + sqlite3VdbeChangeP5(v, 2+IsStat34); | |
| 83755 | 83893 | |
| 83756 | 83894 | /* Implementation of the following: |
| 83757 | 83895 | ** |
| 83758 | 83896 | ** Rewind csr |
| 83759 | 83897 | ** if eof(csr) goto end_of_scan; |
| @@ -83851,11 +83989,11 @@ | ||
| 83851 | 83989 | int regSampleRowid = regCol + nCol; |
| 83852 | 83990 | int addrNext; |
| 83853 | 83991 | int addrIsNull; |
| 83854 | 83992 | u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound; |
| 83855 | 83993 | |
| 83856 | - pParse->nMem = MAX(pParse->nMem, regCol+nCol+1); | |
| 83994 | + pParse->nMem = MAX(pParse->nMem, regCol+nCol); | |
| 83857 | 83995 | |
| 83858 | 83996 | addrNext = sqlite3VdbeCurrentAddr(v); |
| 83859 | 83997 | callStatGet(v, regStat4, STAT_GET_ROWID, regSampleRowid); |
| 83860 | 83998 | addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid); |
| 83861 | 83999 | VdbeCoverage(v); |
| @@ -83873,11 +84011,11 @@ | ||
| 83873 | 84011 | #else |
| 83874 | 84012 | for(i=0; i<nCol; i++){ |
| 83875 | 84013 | i16 iCol = pIdx->aiColumn[i]; |
| 83876 | 84014 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i); |
| 83877 | 84015 | } |
| 83878 | - sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample); | |
| 84016 | + sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol, regSample); | |
| 83879 | 84017 | #endif |
| 83880 | 84018 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp); |
| 83881 | 84019 | sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid); |
| 83882 | 84020 | sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid); |
| 83883 | 84021 | sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */ |
| @@ -84185,11 +84323,20 @@ | ||
| 84185 | 84323 | static void initAvgEq(Index *pIdx){ |
| 84186 | 84324 | if( pIdx ){ |
| 84187 | 84325 | IndexSample *aSample = pIdx->aSample; |
| 84188 | 84326 | IndexSample *pFinal = &aSample[pIdx->nSample-1]; |
| 84189 | 84327 | int iCol; |
| 84190 | - for(iCol=0; iCol<pIdx->nKeyCol; iCol++){ | |
| 84328 | + int nCol = 1; | |
| 84329 | + if( pIdx->nSampleCol>1 ){ | |
| 84330 | + /* If this is stat4 data, then calculate aAvgEq[] values for all | |
| 84331 | + ** sample columns except the last. The last is always set to 1, as | |
| 84332 | + ** once the trailing PK fields are considered all index keys are | |
| 84333 | + ** unique. */ | |
| 84334 | + nCol = pIdx->nSampleCol-1; | |
| 84335 | + pIdx->aAvgEq[nCol] = 1; | |
| 84336 | + } | |
| 84337 | + for(iCol=0; iCol<nCol; iCol++){ | |
| 84191 | 84338 | int i; /* Used to iterate through samples */ |
| 84192 | 84339 | tRowcnt sumEq = 0; /* Sum of the nEq values */ |
| 84193 | 84340 | tRowcnt nSum = 0; /* Number of terms contributing to sumEq */ |
| 84194 | 84341 | tRowcnt avgEq = 0; |
| 84195 | 84342 | tRowcnt nDLt = pFinal->anDLt[iCol]; |
| @@ -84208,11 +84355,10 @@ | ||
| 84208 | 84355 | if( nDLt>nSum ){ |
| 84209 | 84356 | avgEq = (pFinal->anLt[iCol] - sumEq)/(nDLt - nSum); |
| 84210 | 84357 | } |
| 84211 | 84358 | if( avgEq==0 ) avgEq = 1; |
| 84212 | 84359 | pIdx->aAvgEq[iCol] = avgEq; |
| 84213 | - if( pIdx->nSampleCol==1 ) break; | |
| 84214 | 84360 | } |
| 84215 | 84361 | } |
| 84216 | 84362 | } |
| 84217 | 84363 | |
| 84218 | 84364 | /* |
| @@ -84267,11 +84413,10 @@ | ||
| 84267 | 84413 | sqlite3DbFree(db, zSql); |
| 84268 | 84414 | if( rc ) return rc; |
| 84269 | 84415 | |
| 84270 | 84416 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 84271 | 84417 | int nIdxCol = 1; /* Number of columns in stat4 records */ |
| 84272 | - int nAvgCol = 1; /* Number of entries in Index.aAvgEq */ | |
| 84273 | 84418 | |
| 84274 | 84419 | char *zIndex; /* Index name */ |
| 84275 | 84420 | Index *pIdx; /* Pointer to the index object */ |
| 84276 | 84421 | int nSample; /* Number of samples */ |
| 84277 | 84422 | int nByte; /* Bytes of space required */ |
| @@ -84285,25 +84430,29 @@ | ||
| 84285 | 84430 | assert( pIdx==0 || bStat3 || pIdx->nSample==0 ); |
| 84286 | 84431 | /* Index.nSample is non-zero at this point if data has already been |
| 84287 | 84432 | ** loaded from the stat4 table. In this case ignore stat3 data. */ |
| 84288 | 84433 | if( pIdx==0 || pIdx->nSample ) continue; |
| 84289 | 84434 | if( bStat3==0 ){ |
| 84290 | - nIdxCol = pIdx->nKeyCol+1; | |
| 84291 | - nAvgCol = pIdx->nKeyCol; | |
| 84435 | + assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 ); | |
| 84436 | + if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){ | |
| 84437 | + nIdxCol = pIdx->nKeyCol; | |
| 84438 | + }else{ | |
| 84439 | + nIdxCol = pIdx->nColumn; | |
| 84440 | + } | |
| 84292 | 84441 | } |
| 84293 | 84442 | pIdx->nSampleCol = nIdxCol; |
| 84294 | 84443 | nByte = sizeof(IndexSample) * nSample; |
| 84295 | 84444 | nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample; |
| 84296 | - nByte += nAvgCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */ | |
| 84445 | + nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */ | |
| 84297 | 84446 | |
| 84298 | 84447 | pIdx->aSample = sqlite3DbMallocZero(db, nByte); |
| 84299 | 84448 | if( pIdx->aSample==0 ){ |
| 84300 | 84449 | sqlite3_finalize(pStmt); |
| 84301 | 84450 | return SQLITE_NOMEM; |
| 84302 | 84451 | } |
| 84303 | 84452 | pSpace = (tRowcnt*)&pIdx->aSample[nSample]; |
| 84304 | - pIdx->aAvgEq = pSpace; pSpace += nAvgCol; | |
| 84453 | + pIdx->aAvgEq = pSpace; pSpace += nIdxCol; | |
| 84305 | 84454 | for(i=0; i<nSample; i++){ |
| 84306 | 84455 | pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol; |
| 84307 | 84456 | pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol; |
| 84308 | 84457 | pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol; |
| 84309 | 84458 | } |
| @@ -92553,10 +92702,11 @@ | ||
| 92553 | 92702 | FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92554 | 92703 | FUNCTION(hex, 1, 0, 0, hexFunc ), |
| 92555 | 92704 | FUNCTION2(ifnull, 2, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92556 | 92705 | FUNCTION2(unlikely, 1, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92557 | 92706 | FUNCTION2(likelihood, 2, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92707 | + FUNCTION2(likely, 1, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), | |
| 92558 | 92708 | VFUNCTION(random, 0, 0, 0, randomFunc ), |
| 92559 | 92709 | VFUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 92560 | 92710 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 92561 | 92711 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 92562 | 92712 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| @@ -110581,11 +110731,11 @@ | ||
| 110581 | 110731 | pScan->pOrigWC = pWC; |
| 110582 | 110732 | pScan->pWC = pWC; |
| 110583 | 110733 | if( pIdx && iColumn>=0 ){ |
| 110584 | 110734 | pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity; |
| 110585 | 110735 | for(j=0; pIdx->aiColumn[j]!=iColumn; j++){ |
| 110586 | - if( NEVER(j>=pIdx->nKeyCol) ) return 0; | |
| 110736 | + if( NEVER(j>pIdx->nColumn) ) return 0; | |
| 110587 | 110737 | } |
| 110588 | 110738 | pScan->zCollName = pIdx->azColl[j]; |
| 110589 | 110739 | }else{ |
| 110590 | 110740 | pScan->idxaff = 0; |
| 110591 | 110741 | pScan->zCollName = 0; |
| @@ -111531,12 +111681,11 @@ | ||
| 111531 | 111681 | |
| 111532 | 111682 | /* |
| 111533 | 111683 | ** Estimate the logarithm of the input value to base 2. |
| 111534 | 111684 | */ |
| 111535 | 111685 | static LogEst estLog(LogEst N){ |
| 111536 | - LogEst x = sqlite3LogEst(N); | |
| 111537 | - return x>33 ? x - 33 : 0; | |
| 111686 | + return N<=10 ? 0 : sqlite3LogEst(N) - 33; | |
| 111538 | 111687 | } |
| 111539 | 111688 | |
| 111540 | 111689 | /* |
| 111541 | 111690 | ** Two routines for printing the content of an sqlite3_index_info |
| 111542 | 111691 | ** structure. Used for testing and debugging only. If neither |
| @@ -111997,11 +112146,11 @@ | ||
| 111997 | 112146 | }else{ |
| 111998 | 112147 | i64 nRow0 = sqlite3LogEstToInt(pIdx->aiRowLogEst[0]); |
| 111999 | 112148 | iUpper = i>=pIdx->nSample ? nRow0 : aSample[i].anLt[iCol]; |
| 112000 | 112149 | iLower = aSample[i-1].anEq[iCol] + aSample[i-1].anLt[iCol]; |
| 112001 | 112150 | } |
| 112002 | - aStat[1] = (pIdx->nKeyCol>iCol ? pIdx->aAvgEq[iCol] : 1); | |
| 112151 | + aStat[1] = pIdx->aAvgEq[iCol]; | |
| 112003 | 112152 | if( iLower>=iUpper ){ |
| 112004 | 112153 | iGap = 0; |
| 112005 | 112154 | }else{ |
| 112006 | 112155 | iGap = iUpper - iLower; |
| 112007 | 112156 | } |
| @@ -112036,10 +112185,118 @@ | ||
| 112036 | 112185 | } |
| 112037 | 112186 | } |
| 112038 | 112187 | return nRet; |
| 112039 | 112188 | } |
| 112040 | 112189 | |
| 112190 | +#ifdef SQLITE_ENABLE_STAT3_OR_STAT4 | |
| 112191 | +/* | |
| 112192 | +** This function is called to estimate the number of rows visited by a | |
| 112193 | +** range-scan on a skip-scan index. For example: | |
| 112194 | +** | |
| 112195 | +** CREATE INDEX i1 ON t1(a, b, c); | |
| 112196 | +** SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?; | |
| 112197 | +** | |
| 112198 | +** Value pLoop->nOut is currently set to the estimated number of rows | |
| 112199 | +** visited for scanning (a=? AND b=?). This function reduces that estimate | |
| 112200 | +** by some factor to account for the (c BETWEEN ? AND ?) expression based | |
| 112201 | +** on the stat4 data for the index. this scan will be peformed multiple | |
| 112202 | +** times (once for each (a,b) combination that matches a=?) is dealt with | |
| 112203 | +** by the caller. | |
| 112204 | +** | |
| 112205 | +** It does this by scanning through all stat4 samples, comparing values | |
| 112206 | +** extracted from pLower and pUpper with the corresponding column in each | |
| 112207 | +** sample. If L and U are the number of samples found to be less than or | |
| 112208 | +** equal to the values extracted from pLower and pUpper respectively, and | |
| 112209 | +** N is the total number of samples, the pLoop->nOut value is adjusted | |
| 112210 | +** as follows: | |
| 112211 | +** | |
| 112212 | +** nOut = nOut * ( min(U - L, 1) / N ) | |
| 112213 | +** | |
| 112214 | +** If pLower is NULL, or a value cannot be extracted from the term, L is | |
| 112215 | +** set to zero. If pUpper is NULL, or a value cannot be extracted from it, | |
| 112216 | +** U is set to N. | |
| 112217 | +** | |
| 112218 | +** Normally, this function sets *pbDone to 1 before returning. However, | |
| 112219 | +** if no value can be extracted from either pLower or pUpper (and so the | |
| 112220 | +** estimate of the number of rows delivered remains unchanged), *pbDone | |
| 112221 | +** is left as is. | |
| 112222 | +** | |
| 112223 | +** If an error occurs, an SQLite error code is returned. Otherwise, | |
| 112224 | +** SQLITE_OK. | |
| 112225 | +*/ | |
| 112226 | +static int whereRangeSkipScanEst( | |
| 112227 | + Parse *pParse, /* Parsing & code generating context */ | |
| 112228 | + WhereTerm *pLower, /* Lower bound on the range. ex: "x>123" Might be NULL */ | |
| 112229 | + WhereTerm *pUpper, /* Upper bound on the range. ex: "x<455" Might be NULL */ | |
| 112230 | + WhereLoop *pLoop, /* Update the .nOut value of this loop */ | |
| 112231 | + int *pbDone /* Set to true if at least one expr. value extracted */ | |
| 112232 | +){ | |
| 112233 | + Index *p = pLoop->u.btree.pIndex; | |
| 112234 | + int nEq = pLoop->u.btree.nEq; | |
| 112235 | + sqlite3 *db = pParse->db; | |
| 112236 | + int nLower = -1; | |
| 112237 | + int nUpper = p->nSample+1; | |
| 112238 | + int rc = SQLITE_OK; | |
| 112239 | + u8 aff = p->pTable->aCol[ p->aiColumn[nEq] ].affinity; | |
| 112240 | + CollSeq *pColl; | |
| 112241 | + | |
| 112242 | + sqlite3_value *p1 = 0; /* Value extracted from pLower */ | |
| 112243 | + sqlite3_value *p2 = 0; /* Value extracted from pUpper */ | |
| 112244 | + sqlite3_value *pVal = 0; /* Value extracted from record */ | |
| 112245 | + | |
| 112246 | + pColl = sqlite3LocateCollSeq(pParse, p->azColl[nEq]); | |
| 112247 | + if( pLower ){ | |
| 112248 | + rc = sqlite3Stat4ValueFromExpr(pParse, pLower->pExpr->pRight, aff, &p1); | |
| 112249 | + nLower = 0; | |
| 112250 | + } | |
| 112251 | + if( pUpper && rc==SQLITE_OK ){ | |
| 112252 | + rc = sqlite3Stat4ValueFromExpr(pParse, pUpper->pExpr->pRight, aff, &p2); | |
| 112253 | + nUpper = p2 ? 0 : p->nSample; | |
| 112254 | + } | |
| 112255 | + | |
| 112256 | + if( p1 || p2 ){ | |
| 112257 | + int i; | |
| 112258 | + int nDiff; | |
| 112259 | + for(i=0; rc==SQLITE_OK && i<p->nSample; i++){ | |
| 112260 | + rc = sqlite3Stat4Column(db, p->aSample[i].p, p->aSample[i].n, nEq, &pVal); | |
| 112261 | + if( rc==SQLITE_OK && p1 ){ | |
| 112262 | + int res = sqlite3MemCompare(p1, pVal, pColl); | |
| 112263 | + if( res>=0 ) nLower++; | |
| 112264 | + } | |
| 112265 | + if( rc==SQLITE_OK && p2 ){ | |
| 112266 | + int res = sqlite3MemCompare(p2, pVal, pColl); | |
| 112267 | + if( res>=0 ) nUpper++; | |
| 112268 | + } | |
| 112269 | + } | |
| 112270 | + nDiff = (nUpper - nLower); | |
| 112271 | + if( nDiff<=0 ) nDiff = 1; | |
| 112272 | + | |
| 112273 | + /* If there is both an upper and lower bound specified, and the | |
| 112274 | + ** comparisons indicate that they are close together, use the fallback | |
| 112275 | + ** method (assume that the scan visits 1/64 of the rows) for estimating | |
| 112276 | + ** the number of rows visited. Otherwise, estimate the number of rows | |
| 112277 | + ** using the method described in the header comment for this function. */ | |
| 112278 | + if( nDiff!=1 || pUpper==0 || pLower==0 ){ | |
| 112279 | + int nAdjust = (sqlite3LogEst(p->nSample) - sqlite3LogEst(nDiff)); | |
| 112280 | + pLoop->nOut -= nAdjust; | |
| 112281 | + *pbDone = 1; | |
| 112282 | + WHERETRACE(0x10, ("range skip-scan regions: %u..%u adjust=%d est=%d\n", | |
| 112283 | + nLower, nUpper, nAdjust*-1, pLoop->nOut)); | |
| 112284 | + } | |
| 112285 | + | |
| 112286 | + }else{ | |
| 112287 | + assert( *pbDone==0 ); | |
| 112288 | + } | |
| 112289 | + | |
| 112290 | + sqlite3ValueFree(p1); | |
| 112291 | + sqlite3ValueFree(p2); | |
| 112292 | + sqlite3ValueFree(pVal); | |
| 112293 | + | |
| 112294 | + return rc; | |
| 112295 | +} | |
| 112296 | +#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */ | |
| 112297 | + | |
| 112041 | 112298 | /* |
| 112042 | 112299 | ** This function is used to estimate the number of rows that will be visited |
| 112043 | 112300 | ** by scanning an index for a range of values. The range may have an upper |
| 112044 | 112301 | ** bound, a lower bound, or both. The WHERE clause terms that set the upper |
| 112045 | 112302 | ** and lower bounds are represented by pLower and pUpper respectively. For |
| @@ -112072,13 +112329,13 @@ | ||
| 112072 | 112329 | ** considering the range constraints. If nEq is 0, this is the number of |
| 112073 | 112330 | ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) |
| 112074 | 112331 | ** to account for the range contraints pLower and pUpper. |
| 112075 | 112332 | ** |
| 112076 | 112333 | ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be |
| 112077 | -** used, each range inequality reduces the search space by a factor of 4. | |
| 112078 | -** Hence a pair of constraints (x>? AND x<?) reduces the expected number of | |
| 112079 | -** rows visited by a factor of 16. | |
| 112334 | +** used, a single range inequality reduces the search space by a factor of 4. | |
| 112335 | +** and a pair of constraints (x>? AND x<?) reduces the expected number of | |
| 112336 | +** rows visited by a factor of 64. | |
| 112080 | 112337 | */ |
| 112081 | 112338 | static int whereRangeScanEst( |
| 112082 | 112339 | Parse *pParse, /* Parsing & code generating context */ |
| 112083 | 112340 | WhereLoopBuilder *pBuilder, |
| 112084 | 112341 | WhereTerm *pLower, /* Lower bound on the range. ex: "x>123" Might be NULL */ |
| @@ -112092,99 +112349,104 @@ | ||
| 112092 | 112349 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 112093 | 112350 | Index *p = pLoop->u.btree.pIndex; |
| 112094 | 112351 | int nEq = pLoop->u.btree.nEq; |
| 112095 | 112352 | |
| 112096 | 112353 | if( p->nSample>0 |
| 112097 | - && nEq==pBuilder->nRecValid | |
| 112098 | 112354 | && nEq<p->nSampleCol |
| 112099 | 112355 | && OptimizationEnabled(pParse->db, SQLITE_Stat3) |
| 112100 | 112356 | ){ |
| 112101 | - UnpackedRecord *pRec = pBuilder->pRec; | |
| 112102 | - tRowcnt a[2]; | |
| 112103 | - u8 aff; | |
| 112104 | - | |
| 112105 | - /* Variable iLower will be set to the estimate of the number of rows in | |
| 112106 | - ** the index that are less than the lower bound of the range query. The | |
| 112107 | - ** lower bound being the concatenation of $P and $L, where $P is the | |
| 112108 | - ** key-prefix formed by the nEq values matched against the nEq left-most | |
| 112109 | - ** columns of the index, and $L is the value in pLower. | |
| 112110 | - ** | |
| 112111 | - ** Or, if pLower is NULL or $L cannot be extracted from it (because it | |
| 112112 | - ** is not a simple variable or literal value), the lower bound of the | |
| 112113 | - ** range is $P. Due to a quirk in the way whereKeyStats() works, even | |
| 112114 | - ** if $L is available, whereKeyStats() is called for both ($P) and | |
| 112115 | - ** ($P:$L) and the larger of the two returned values used. | |
| 112116 | - ** | |
| 112117 | - ** Similarly, iUpper is to be set to the estimate of the number of rows | |
| 112118 | - ** less than the upper bound of the range query. Where the upper bound | |
| 112119 | - ** is either ($P) or ($P:$U). Again, even if $U is available, both values | |
| 112120 | - ** of iUpper are requested of whereKeyStats() and the smaller used. | |
| 112121 | - */ | |
| 112122 | - tRowcnt iLower; | |
| 112123 | - tRowcnt iUpper; | |
| 112124 | - | |
| 112125 | - if( nEq==p->nKeyCol ){ | |
| 112126 | - aff = SQLITE_AFF_INTEGER; | |
| 112127 | - }else{ | |
| 112128 | - aff = p->pTable->aCol[p->aiColumn[nEq]].affinity; | |
| 112129 | - } | |
| 112130 | - /* Determine iLower and iUpper using ($P) only. */ | |
| 112131 | - if( nEq==0 ){ | |
| 112132 | - iLower = 0; | |
| 112133 | - iUpper = sqlite3LogEstToInt(p->aiRowLogEst[0]); | |
| 112134 | - }else{ | |
| 112135 | - /* Note: this call could be optimized away - since the same values must | |
| 112136 | - ** have been requested when testing key $P in whereEqualScanEst(). */ | |
| 112137 | - whereKeyStats(pParse, p, pRec, 0, a); | |
| 112138 | - iLower = a[0]; | |
| 112139 | - iUpper = a[0] + a[1]; | |
| 112140 | - } | |
| 112141 | - | |
| 112142 | - /* If possible, improve on the iLower estimate using ($P:$L). */ | |
| 112143 | - if( pLower ){ | |
| 112144 | - int bOk; /* True if value is extracted from pExpr */ | |
| 112145 | - Expr *pExpr = pLower->pExpr->pRight; | |
| 112146 | - assert( (pLower->eOperator & (WO_GT|WO_GE))!=0 ); | |
| 112147 | - rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); | |
| 112148 | - if( rc==SQLITE_OK && bOk ){ | |
| 112149 | - tRowcnt iNew; | |
| 112150 | - whereKeyStats(pParse, p, pRec, 0, a); | |
| 112151 | - iNew = a[0] + ((pLower->eOperator & WO_GT) ? a[1] : 0); | |
| 112152 | - if( iNew>iLower ) iLower = iNew; | |
| 112153 | - nOut--; | |
| 112154 | - } | |
| 112155 | - } | |
| 112156 | - | |
| 112157 | - /* If possible, improve on the iUpper estimate using ($P:$U). */ | |
| 112158 | - if( pUpper ){ | |
| 112159 | - int bOk; /* True if value is extracted from pExpr */ | |
| 112160 | - Expr *pExpr = pUpper->pExpr->pRight; | |
| 112161 | - assert( (pUpper->eOperator & (WO_LT|WO_LE))!=0 ); | |
| 112162 | - rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); | |
| 112163 | - if( rc==SQLITE_OK && bOk ){ | |
| 112164 | - tRowcnt iNew; | |
| 112165 | - whereKeyStats(pParse, p, pRec, 1, a); | |
| 112166 | - iNew = a[0] + ((pUpper->eOperator & WO_LE) ? a[1] : 0); | |
| 112167 | - if( iNew<iUpper ) iUpper = iNew; | |
| 112168 | - nOut--; | |
| 112169 | - } | |
| 112170 | - } | |
| 112171 | - | |
| 112172 | - pBuilder->pRec = pRec; | |
| 112173 | - if( rc==SQLITE_OK ){ | |
| 112174 | - if( iUpper>iLower ){ | |
| 112175 | - nNew = sqlite3LogEst(iUpper - iLower); | |
| 112176 | - }else{ | |
| 112177 | - nNew = 10; assert( 10==sqlite3LogEst(2) ); | |
| 112178 | - } | |
| 112179 | - if( nNew<nOut ){ | |
| 112180 | - nOut = nNew; | |
| 112181 | - } | |
| 112182 | - pLoop->nOut = (LogEst)nOut; | |
| 112183 | - WHERETRACE(0x10, ("range scan regions: %u..%u est=%d\n", | |
| 112184 | - (u32)iLower, (u32)iUpper, nOut)); | |
| 112185 | - return SQLITE_OK; | |
| 112357 | + if( nEq==pBuilder->nRecValid ){ | |
| 112358 | + UnpackedRecord *pRec = pBuilder->pRec; | |
| 112359 | + tRowcnt a[2]; | |
| 112360 | + u8 aff; | |
| 112361 | + | |
| 112362 | + /* Variable iLower will be set to the estimate of the number of rows in | |
| 112363 | + ** the index that are less than the lower bound of the range query. The | |
| 112364 | + ** lower bound being the concatenation of $P and $L, where $P is the | |
| 112365 | + ** key-prefix formed by the nEq values matched against the nEq left-most | |
| 112366 | + ** columns of the index, and $L is the value in pLower. | |
| 112367 | + ** | |
| 112368 | + ** Or, if pLower is NULL or $L cannot be extracted from it (because it | |
| 112369 | + ** is not a simple variable or literal value), the lower bound of the | |
| 112370 | + ** range is $P. Due to a quirk in the way whereKeyStats() works, even | |
| 112371 | + ** if $L is available, whereKeyStats() is called for both ($P) and | |
| 112372 | + ** ($P:$L) and the larger of the two returned values used. | |
| 112373 | + ** | |
| 112374 | + ** Similarly, iUpper is to be set to the estimate of the number of rows | |
| 112375 | + ** less than the upper bound of the range query. Where the upper bound | |
| 112376 | + ** is either ($P) or ($P:$U). Again, even if $U is available, both values | |
| 112377 | + ** of iUpper are requested of whereKeyStats() and the smaller used. | |
| 112378 | + */ | |
| 112379 | + tRowcnt iLower; | |
| 112380 | + tRowcnt iUpper; | |
| 112381 | + | |
| 112382 | + if( nEq==p->nKeyCol ){ | |
| 112383 | + aff = SQLITE_AFF_INTEGER; | |
| 112384 | + }else{ | |
| 112385 | + aff = p->pTable->aCol[p->aiColumn[nEq]].affinity; | |
| 112386 | + } | |
| 112387 | + /* Determine iLower and iUpper using ($P) only. */ | |
| 112388 | + if( nEq==0 ){ | |
| 112389 | + iLower = 0; | |
| 112390 | + iUpper = sqlite3LogEstToInt(p->aiRowLogEst[0]); | |
| 112391 | + }else{ | |
| 112392 | + /* Note: this call could be optimized away - since the same values must | |
| 112393 | + ** have been requested when testing key $P in whereEqualScanEst(). */ | |
| 112394 | + whereKeyStats(pParse, p, pRec, 0, a); | |
| 112395 | + iLower = a[0]; | |
| 112396 | + iUpper = a[0] + a[1]; | |
| 112397 | + } | |
| 112398 | + | |
| 112399 | + /* If possible, improve on the iLower estimate using ($P:$L). */ | |
| 112400 | + if( pLower ){ | |
| 112401 | + int bOk; /* True if value is extracted from pExpr */ | |
| 112402 | + Expr *pExpr = pLower->pExpr->pRight; | |
| 112403 | + assert( (pLower->eOperator & (WO_GT|WO_GE))!=0 ); | |
| 112404 | + rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); | |
| 112405 | + if( rc==SQLITE_OK && bOk ){ | |
| 112406 | + tRowcnt iNew; | |
| 112407 | + whereKeyStats(pParse, p, pRec, 0, a); | |
| 112408 | + iNew = a[0] + ((pLower->eOperator & WO_GT) ? a[1] : 0); | |
| 112409 | + if( iNew>iLower ) iLower = iNew; | |
| 112410 | + nOut--; | |
| 112411 | + } | |
| 112412 | + } | |
| 112413 | + | |
| 112414 | + /* If possible, improve on the iUpper estimate using ($P:$U). */ | |
| 112415 | + if( pUpper ){ | |
| 112416 | + int bOk; /* True if value is extracted from pExpr */ | |
| 112417 | + Expr *pExpr = pUpper->pExpr->pRight; | |
| 112418 | + assert( (pUpper->eOperator & (WO_LT|WO_LE))!=0 ); | |
| 112419 | + rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); | |
| 112420 | + if( rc==SQLITE_OK && bOk ){ | |
| 112421 | + tRowcnt iNew; | |
| 112422 | + whereKeyStats(pParse, p, pRec, 1, a); | |
| 112423 | + iNew = a[0] + ((pUpper->eOperator & WO_LE) ? a[1] : 0); | |
| 112424 | + if( iNew<iUpper ) iUpper = iNew; | |
| 112425 | + nOut--; | |
| 112426 | + } | |
| 112427 | + } | |
| 112428 | + | |
| 112429 | + pBuilder->pRec = pRec; | |
| 112430 | + if( rc==SQLITE_OK ){ | |
| 112431 | + if( iUpper>iLower ){ | |
| 112432 | + nNew = sqlite3LogEst(iUpper - iLower); | |
| 112433 | + }else{ | |
| 112434 | + nNew = 10; assert( 10==sqlite3LogEst(2) ); | |
| 112435 | + } | |
| 112436 | + if( nNew<nOut ){ | |
| 112437 | + nOut = nNew; | |
| 112438 | + } | |
| 112439 | + pLoop->nOut = (LogEst)nOut; | |
| 112440 | + WHERETRACE(0x10, ("range scan regions: %u..%u est=%d\n", | |
| 112441 | + (u32)iLower, (u32)iUpper, nOut)); | |
| 112442 | + return SQLITE_OK; | |
| 112443 | + } | |
| 112444 | + }else{ | |
| 112445 | + int bDone = 0; | |
| 112446 | + rc = whereRangeSkipScanEst(pParse, pLower, pUpper, pLoop, &bDone); | |
| 112447 | + if( bDone ) return rc; | |
| 112186 | 112448 | } |
| 112187 | 112449 | } |
| 112188 | 112450 | #else |
| 112189 | 112451 | UNUSED_PARAMETER(pParse); |
| 112190 | 112452 | UNUSED_PARAMETER(pBuilder); |
| @@ -112239,11 +112501,11 @@ | ||
| 112239 | 112501 | int rc; /* Subfunction return code */ |
| 112240 | 112502 | tRowcnt a[2]; /* Statistics */ |
| 112241 | 112503 | int bOk; |
| 112242 | 112504 | |
| 112243 | 112505 | assert( nEq>=1 ); |
| 112244 | - assert( nEq<=(p->nKeyCol+1) ); | |
| 112506 | + assert( nEq<=p->nColumn ); | |
| 112245 | 112507 | assert( p->aSample!=0 ); |
| 112246 | 112508 | assert( p->nSample>0 ); |
| 112247 | 112509 | assert( pBuilder->nRecValid<nEq ); |
| 112248 | 112510 | |
| 112249 | 112511 | /* If values are not available for all fields of the index to the left |
| @@ -112252,11 +112514,11 @@ | ||
| 112252 | 112514 | return SQLITE_NOTFOUND; |
| 112253 | 112515 | } |
| 112254 | 112516 | |
| 112255 | 112517 | /* This is an optimization only. The call to sqlite3Stat4ProbeSetValue() |
| 112256 | 112518 | ** below would return the same value. */ |
| 112257 | - if( nEq>p->nKeyCol ){ | |
| 112519 | + if( nEq>=p->nColumn ){ | |
| 112258 | 112520 | *pnRow = 1; |
| 112259 | 112521 | return SQLITE_OK; |
| 112260 | 112522 | } |
| 112261 | 112523 | |
| 112262 | 112524 | aff = p->pTable->aCol[p->aiColumn[nEq-1]].affinity; |
| @@ -112683,11 +112945,11 @@ | ||
| 112683 | 112945 | } |
| 112684 | 112946 | sqlite3StrAccumInit(&txt, 0, 0, SQLITE_MAX_LENGTH); |
| 112685 | 112947 | txt.db = db; |
| 112686 | 112948 | sqlite3StrAccumAppend(&txt, " (", 2); |
| 112687 | 112949 | for(i=0; i<nEq; i++){ |
| 112688 | - char *z = (i==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[i]].zName; | |
| 112950 | + char *z = aiColumn[i] < 0 ? "rowid" : aCol[aiColumn[i]].zName; | |
| 112689 | 112951 | if( i>=nSkip ){ |
| 112690 | 112952 | explainAppendTerm(&txt, i, z, "="); |
| 112691 | 112953 | }else{ |
| 112692 | 112954 | if( i ) sqlite3StrAccumAppend(&txt, " AND ", 5); |
| 112693 | 112955 | sqlite3StrAccumAppend(&txt, "ANY(", 4); |
| @@ -112696,15 +112958,15 @@ | ||
| 112696 | 112958 | } |
| 112697 | 112959 | } |
| 112698 | 112960 | |
| 112699 | 112961 | j = i; |
| 112700 | 112962 | if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ |
| 112701 | - char *z = (j==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[j]].zName; | |
| 112963 | + char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; | |
| 112702 | 112964 | explainAppendTerm(&txt, i++, z, ">"); |
| 112703 | 112965 | } |
| 112704 | 112966 | if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ |
| 112705 | - char *z = (j==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[j]].zName; | |
| 112967 | + char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; | |
| 112706 | 112968 | explainAppendTerm(&txt, i, z, "<"); |
| 112707 | 112969 | } |
| 112708 | 112970 | sqlite3StrAccumAppend(&txt, ")", 1); |
| 112709 | 112971 | return sqlite3StrAccumFinish(&txt); |
| 112710 | 112972 | } |
| @@ -113724,11 +113986,11 @@ | ||
| 113724 | 113986 | z = sqlite3_mprintf("(%d,%x)", p->u.vtab.idxNum, p->u.vtab.omitMask); |
| 113725 | 113987 | } |
| 113726 | 113988 | sqlite3DebugPrintf(" %-19s", z); |
| 113727 | 113989 | sqlite3_free(z); |
| 113728 | 113990 | } |
| 113729 | - sqlite3DebugPrintf(" f %04x N %d", p->wsFlags, p->nLTerm); | |
| 113991 | + sqlite3DebugPrintf(" f %05x N %d", p->wsFlags, p->nLTerm); | |
| 113730 | 113992 | sqlite3DebugPrintf(" cost %d,%d,%d\n", p->rSetup, p->rRun, p->nOut); |
| 113731 | 113993 | #ifdef SQLITE_ENABLE_TREE_EXPLAIN |
| 113732 | 113994 | /* If the 0x100 bit of wheretracing is set, then show all of the constraint |
| 113733 | 113995 | ** expressions in the WhereLoop.aLTerm[] array. |
| 113734 | 113996 | */ |
| @@ -113960,10 +114222,21 @@ | ||
| 113960 | 114222 | |
| 113961 | 114223 | /* whereLoopAddBtree() always generates and inserts the automatic index |
| 113962 | 114224 | ** case first. Hence compatible candidate WhereLoops never have a larger |
| 113963 | 114225 | ** rSetup. Call this SETUP-INVARIANT */ |
| 113964 | 114226 | assert( p->rSetup>=pTemplate->rSetup ); |
| 114227 | + | |
| 114228 | + /* Any loop using an appliation-defined index (or PRIMARY KEY or | |
| 114229 | + ** UNIQUE constraint) with one or more == constraints is better | |
| 114230 | + ** than an automatic index. */ | |
| 114231 | + if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 | |
| 114232 | + && (pTemplate->wsFlags & WHERE_INDEXED)!=0 | |
| 114233 | + && (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0 | |
| 114234 | + && (p->prereq & pTemplate->prereq)==pTemplate->prereq | |
| 114235 | + ){ | |
| 114236 | + break; | |
| 114237 | + } | |
| 113965 | 114238 | |
| 113966 | 114239 | /* If existing WhereLoop p is better than pTemplate, pTemplate can be |
| 113967 | 114240 | ** discarded. WhereLoop p is better if: |
| 113968 | 114241 | ** (1) p has no more dependencies than pTemplate, and |
| 113969 | 114242 | ** (2) p has an equal or lower cost than pTemplate |
| @@ -114085,17 +114358,17 @@ | ||
| 114085 | 114358 | ** p[] that are also supplated by pTemplate */ |
| 114086 | 114359 | WhereLoop **ppTail = &p->pNextLoop; |
| 114087 | 114360 | WhereLoop *pToDel; |
| 114088 | 114361 | while( *ppTail ){ |
| 114089 | 114362 | ppTail = whereLoopFindLesser(ppTail, pTemplate); |
| 114090 | - if( NEVER(ppTail==0) ) break; | |
| 114363 | + if( ppTail==0 ) break; | |
| 114091 | 114364 | pToDel = *ppTail; |
| 114092 | 114365 | if( pToDel==0 ) break; |
| 114093 | 114366 | *ppTail = pToDel->pNextLoop; |
| 114094 | 114367 | #if WHERETRACE_ENABLED /* 0x8 */ |
| 114095 | 114368 | if( sqlite3WhereTrace & 0x8 ){ |
| 114096 | - sqlite3DebugPrintf("ins-del: "); | |
| 114369 | + sqlite3DebugPrintf("ins-del: "); | |
| 114097 | 114370 | whereLoopPrint(pToDel, pBuilder->pWC); |
| 114098 | 114371 | } |
| 114099 | 114372 | #endif |
| 114100 | 114373 | whereLoopDelete(db, pToDel); |
| 114101 | 114374 | } |
| @@ -114191,16 +114464,13 @@ | ||
| 114191 | 114464 | }else{ |
| 114192 | 114465 | opMask = WO_EQ|WO_IN|WO_ISNULL|WO_GT|WO_GE|WO_LT|WO_LE; |
| 114193 | 114466 | } |
| 114194 | 114467 | if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); |
| 114195 | 114468 | |
| 114196 | - assert( pNew->u.btree.nEq<=pProbe->nKeyCol ); | |
| 114197 | - if( pNew->u.btree.nEq < pProbe->nKeyCol ){ | |
| 114198 | - iCol = pProbe->aiColumn[pNew->u.btree.nEq]; | |
| 114199 | - }else{ | |
| 114200 | - iCol = -1; | |
| 114201 | - } | |
| 114469 | + assert( pNew->u.btree.nEq<pProbe->nColumn ); | |
| 114470 | + iCol = pProbe->aiColumn[pNew->u.btree.nEq]; | |
| 114471 | + | |
| 114202 | 114472 | pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, iCol, |
| 114203 | 114473 | opMask, pProbe); |
| 114204 | 114474 | saved_nEq = pNew->u.btree.nEq; |
| 114205 | 114475 | saved_nSkip = pNew->u.btree.nSkip; |
| 114206 | 114476 | saved_nLTerm = pNew->nLTerm; |
| @@ -114386,11 +114656,11 @@ | ||
| 114386 | 114656 | }else{ |
| 114387 | 114657 | pNew->nOut = nOutUnadjusted; |
| 114388 | 114658 | } |
| 114389 | 114659 | |
| 114390 | 114660 | if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 |
| 114391 | - && pNew->u.btree.nEq<(pProbe->nKeyCol + (pProbe->zName!=0)) | |
| 114661 | + && pNew->u.btree.nEq<pProbe->nColumn | |
| 114392 | 114662 | ){ |
| 114393 | 114663 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn); |
| 114394 | 114664 | } |
| 114395 | 114665 | pNew->nOut = saved_nOut; |
| 114396 | 114666 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| @@ -114533,10 +114803,11 @@ | ||
| 114533 | 114803 | ** fake index the first in a chain of Index objects with all of the real |
| 114534 | 114804 | ** indices to follow */ |
| 114535 | 114805 | Index *pFirst; /* First of real indices on the table */ |
| 114536 | 114806 | memset(&sPk, 0, sizeof(Index)); |
| 114537 | 114807 | sPk.nKeyCol = 1; |
| 114808 | + sPk.nColumn = 1; | |
| 114538 | 114809 | sPk.aiColumn = &aiColumnPk; |
| 114539 | 114810 | sPk.aiRowLogEst = aiRowEstPk; |
| 114540 | 114811 | sPk.onError = OE_Replace; |
| 114541 | 114812 | sPk.pTable = pTab; |
| 114542 | 114813 | sPk.szIdxRow = pTab->szTabRow; |
| @@ -115316,11 +115587,10 @@ | ||
| 115316 | 115587 | int mxI = 0; /* Index of next entry to replace */ |
| 115317 | 115588 | int nOrderBy; /* Number of ORDER BY clause terms */ |
| 115318 | 115589 | LogEst rCost; /* Cost of a path */ |
| 115319 | 115590 | LogEst nOut; /* Number of outputs */ |
| 115320 | 115591 | LogEst mxCost = 0; /* Maximum cost of a set of paths */ |
| 115321 | - LogEst mxOut = 0; /* Maximum nOut value on the set of paths */ | |
| 115322 | 115592 | int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */ |
| 115323 | 115593 | WherePath *aFrom; /* All nFrom paths at the previous level */ |
| 115324 | 115594 | WherePath *aTo; /* The nTo best paths at the current level */ |
| 115325 | 115595 | WherePath *pFrom; /* An element of aFrom[] that we are working on */ |
| 115326 | 115596 | WherePath *pTo; /* An element of aTo[] that we are working on */ |
| @@ -115426,12 +115696,10 @@ | ||
| 115426 | 115696 | } |
| 115427 | 115697 | /* Check to see if pWLoop should be added to the mxChoice best so far */ |
| 115428 | 115698 | for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){ |
| 115429 | 115699 | if( pTo->maskLoop==maskNew |
| 115430 | 115700 | && ((pTo->isOrdered^isOrdered)&80)==0 |
| 115431 | - && ((pTo->rCost<=rCost && pTo->nRow<=nOut) || | |
| 115432 | - (pTo->rCost>=rCost && pTo->nRow>=nOut)) | |
| 115433 | 115701 | ){ |
| 115434 | 115702 | testcase( jj==nTo-1 ); |
| 115435 | 115703 | break; |
| 115436 | 115704 | } |
| 115437 | 115705 | } |
| @@ -115461,11 +115729,11 @@ | ||
| 115461 | 115729 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| 115462 | 115730 | isOrdered>=0 ? isOrdered+'0' : '?'); |
| 115463 | 115731 | } |
| 115464 | 115732 | #endif |
| 115465 | 115733 | }else{ |
| 115466 | - if( pTo->rCost<=rCost && pTo->nRow<=nOut ){ | |
| 115734 | + if( pTo->rCost<=rCost ){ | |
| 115467 | 115735 | #ifdef WHERETRACE_ENABLED /* 0x4 */ |
| 115468 | 115736 | if( sqlite3WhereTrace&0x4 ){ |
| 115469 | 115737 | sqlite3DebugPrintf( |
| 115470 | 115738 | "Skip %s cost=%-3d,%3d order=%c", |
| 115471 | 115739 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| @@ -115501,15 +115769,13 @@ | ||
| 115501 | 115769 | memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop); |
| 115502 | 115770 | pTo->aLoop[iLoop] = pWLoop; |
| 115503 | 115771 | if( nTo>=mxChoice ){ |
| 115504 | 115772 | mxI = 0; |
| 115505 | 115773 | mxCost = aTo[0].rCost; |
| 115506 | - mxOut = aTo[0].nRow; | |
| 115507 | 115774 | for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){ |
| 115508 | - if( pTo->rCost>mxCost || (pTo->rCost==mxCost && pTo->nRow>mxOut) ){ | |
| 115775 | + if( pTo->rCost>mxCost ){ | |
| 115509 | 115776 | mxCost = pTo->rCost; |
| 115510 | - mxOut = pTo->nRow; | |
| 115511 | 115777 | mxI = jj; |
| 115512 | 115778 | } |
| 115513 | 115779 | } |
| 115514 | 115780 | } |
| 115515 | 115781 | } |
| @@ -124205,14 +124471,14 @@ | ||
| 124205 | 124471 | ** sqlite3_test_control(). |
| 124206 | 124472 | */ |
| 124207 | 124473 | case SQLITE_TESTCTRL_FAULT_INSTALL: { |
| 124208 | 124474 | /* MSVC is picky about pulling func ptrs from va lists. |
| 124209 | 124475 | ** http://support.microsoft.com/kb/47961 |
| 124210 | - ** sqlite3Config.xTestCallback = va_arg(ap, int(*)(int)); | |
| 124476 | + ** sqlite3GlobalConfig.xTestCallback = va_arg(ap, int(*)(int)); | |
| 124211 | 124477 | */ |
| 124212 | 124478 | typedef int(*TESTCALLBACKFUNC_t)(int); |
| 124213 | - sqlite3Config.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t); | |
| 124479 | + sqlite3GlobalConfig.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t); | |
| 124214 | 124480 | rc = sqlite3FaultSim(0); |
| 124215 | 124481 | break; |
| 124216 | 124482 | } |
| 124217 | 124483 | |
| 124218 | 124484 | /* |
| @@ -140777,38 +141043,40 @@ | ||
| 140777 | 141043 | i64 iDocid = sqlite3_column_int64(pStmt, 0); |
| 140778 | 141044 | int iLang = langidFromSelect(p, pStmt); |
| 140779 | 141045 | int iCol; |
| 140780 | 141046 | |
| 140781 | 141047 | for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){ |
| 140782 | - const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); | |
| 140783 | - int nText = sqlite3_column_bytes(pStmt, iCol+1); | |
| 140784 | - sqlite3_tokenizer_cursor *pT = 0; | |
| 140785 | - | |
| 140786 | - rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText, &pT); | |
| 140787 | - while( rc==SQLITE_OK ){ | |
| 140788 | - char const *zToken; /* Buffer containing token */ | |
| 140789 | - int nToken = 0; /* Number of bytes in token */ | |
| 140790 | - int iDum1 = 0, iDum2 = 0; /* Dummy variables */ | |
| 140791 | - int iPos = 0; /* Position of token in zText */ | |
| 140792 | - | |
| 140793 | - rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); | |
| 140794 | - if( rc==SQLITE_OK ){ | |
| 140795 | - int i; | |
| 140796 | - cksum2 = cksum2 ^ fts3ChecksumEntry( | |
| 140797 | - zToken, nToken, iLang, 0, iDocid, iCol, iPos | |
| 140798 | - ); | |
| 140799 | - for(i=1; i<p->nIndex; i++){ | |
| 140800 | - if( p->aIndex[i].nPrefix<=nToken ){ | |
| 140801 | - cksum2 = cksum2 ^ fts3ChecksumEntry( | |
| 140802 | - zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos | |
| 140803 | - ); | |
| 140804 | - } | |
| 140805 | - } | |
| 140806 | - } | |
| 140807 | - } | |
| 140808 | - if( pT ) pModule->xClose(pT); | |
| 140809 | - if( rc==SQLITE_DONE ) rc = SQLITE_OK; | |
| 141048 | + if( p->abNotindexed[iCol]==0 ){ | |
| 141049 | + const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); | |
| 141050 | + int nText = sqlite3_column_bytes(pStmt, iCol+1); | |
| 141051 | + sqlite3_tokenizer_cursor *pT = 0; | |
| 141052 | + | |
| 141053 | + rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText,&pT); | |
| 141054 | + while( rc==SQLITE_OK ){ | |
| 141055 | + char const *zToken; /* Buffer containing token */ | |
| 141056 | + int nToken = 0; /* Number of bytes in token */ | |
| 141057 | + int iDum1 = 0, iDum2 = 0; /* Dummy variables */ | |
| 141058 | + int iPos = 0; /* Position of token in zText */ | |
| 141059 | + | |
| 141060 | + rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); | |
| 141061 | + if( rc==SQLITE_OK ){ | |
| 141062 | + int i; | |
| 141063 | + cksum2 = cksum2 ^ fts3ChecksumEntry( | |
| 141064 | + zToken, nToken, iLang, 0, iDocid, iCol, iPos | |
| 141065 | + ); | |
| 141066 | + for(i=1; i<p->nIndex; i++){ | |
| 141067 | + if( p->aIndex[i].nPrefix<=nToken ){ | |
| 141068 | + cksum2 = cksum2 ^ fts3ChecksumEntry( | |
| 141069 | + zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos | |
| 141070 | + ); | |
| 141071 | + } | |
| 141072 | + } | |
| 141073 | + } | |
| 141074 | + } | |
| 141075 | + if( pT ) pModule->xClose(pT); | |
| 141076 | + if( rc==SQLITE_DONE ) rc = SQLITE_OK; | |
| 141077 | + } | |
| 140810 | 141078 | } |
| 140811 | 141079 | } |
| 140812 | 141080 | |
| 140813 | 141081 | sqlite3_finalize(pStmt); |
| 140814 | 141082 | } |
| 140815 | 141083 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.8.5. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | |
| 220 | ** |
| 221 | ** See also: [sqlite3_libversion()], |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.5" |
| 226 | #define SQLITE_VERSION_NUMBER 3008005 |
| 227 | #define SQLITE_SOURCE_ID "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -9479,10 +9479,11 @@ | |
| 9479 | SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8); |
| 9480 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 9481 | #ifndef SQLITE_OMIT_TRACE |
| 9482 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 9483 | #endif |
| 9484 | |
| 9485 | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); |
| 9486 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*,int); |
| 9487 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); |
| 9488 | |
| @@ -12885,11 +12886,13 @@ | |
| 12885 | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); |
| 12886 | |
| 12887 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 12888 | SQLITE_PRIVATE void sqlite3AnalyzeFunctions(void); |
| 12889 | SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(Parse*,Index*,UnpackedRecord**,Expr*,u8,int,int*); |
| 12890 | SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord*); |
| 12891 | #endif |
| 12892 | |
| 12893 | /* |
| 12894 | ** The interface to the LEMON-generated parser |
| 12895 | */ |
| @@ -14199,11 +14202,10 @@ | |
| 14199 | SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe*, int, int); |
| 14200 | |
| 14201 | int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); |
| 14202 | SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); |
| 14203 | SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); |
| 14204 | SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); |
| 14205 | SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); |
| 14206 | SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); |
| 14207 | SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); |
| 14208 | SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int); |
| 14209 | SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*); |
| @@ -21562,12 +21564,12 @@ | |
| 21562 | ** * Bytes in the range of 0x80 through 0xbf which occur as the first |
| 21563 | ** byte of a character are interpreted as single-byte characters |
| 21564 | ** and rendered as themselves even though they are technically |
| 21565 | ** invalid characters. |
| 21566 | ** |
| 21567 | ** * This routine accepts an infinite number of different UTF8 encodings |
| 21568 | ** for unicode values 0x80 and greater. It do not change over-length |
| 21569 | ** encodings to 0xfffd as some systems recommend. |
| 21570 | */ |
| 21571 | #define READ_UTF8(zIn, zTerm, c) \ |
| 21572 | c = *(zIn++); \ |
| 21573 | if( c>=0xc0 ){ \ |
| @@ -24371,14 +24373,14 @@ | |
| 24371 | { "mremap", (sqlite3_syscall_ptr)mremap, 0 }, |
| 24372 | #else |
| 24373 | { "mremap", (sqlite3_syscall_ptr)0, 0 }, |
| 24374 | #endif |
| 24375 | #define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent) |
| 24376 | #endif |
| 24377 | |
| 24378 | { "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 }, |
| 24379 | #define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent) |
| 24380 | |
| 24381 | }; /* End of the overrideable system calls */ |
| 24382 | |
| 24383 | /* |
| 24384 | ** This is the xSetSystemCall() method of sqlite3_vfs for all of the |
| @@ -25844,10 +25846,17 @@ | |
| 25844 | osUnlink(pFile->pId->zCanonicalName); |
| 25845 | } |
| 25846 | vxworksReleaseFileId(pFile->pId); |
| 25847 | pFile->pId = 0; |
| 25848 | } |
| 25849 | #endif |
| 25850 | OSTRACE(("CLOSE %-3d\n", pFile->h)); |
| 25851 | OpenCounter(-1); |
| 25852 | sqlite3_free(pFile->pUnused); |
| 25853 | memset(pFile, 0, sizeof(unixFile)); |
| @@ -27883,12 +27892,29 @@ | |
| 27883 | rc |= SQLITE_IOCAP_POWERSAFE_OVERWRITE; |
| 27884 | } |
| 27885 | return rc; |
| 27886 | } |
| 27887 | |
| 27888 | #ifndef SQLITE_OMIT_WAL |
| 27889 | |
| 27890 | |
| 27891 | /* |
| 27892 | ** Object used to represent an shared memory buffer. |
| 27893 | ** |
| 27894 | ** When multiple threads all reference the same wal-index, each thread |
| @@ -28035,24 +28061,10 @@ | |
| 28035 | #endif |
| 28036 | |
| 28037 | return rc; |
| 28038 | } |
| 28039 | |
| 28040 | /* |
| 28041 | ** Return the system page size. |
| 28042 | ** |
| 28043 | ** This function should not be called directly by other code in this file. |
| 28044 | ** Instead, it should be called via macro osGetpagesize(). |
| 28045 | */ |
| 28046 | static int unixGetpagesize(void){ |
| 28047 | #if defined(_BSD_SOURCE) |
| 28048 | return getpagesize(); |
| 28049 | #else |
| 28050 | return (int)sysconf(_SC_PAGESIZE); |
| 28051 | #endif |
| 28052 | } |
| 28053 | |
| 28054 | /* |
| 28055 | ** Return the minimum number of 32KB shm regions that should be mapped at |
| 28056 | ** a time, assuming that each mapping must be an integer multiple of the |
| 28057 | ** current system page-size. |
| 28058 | ** |
| @@ -29698,10 +29710,16 @@ | |
| 29698 | } |
| 29699 | |
| 29700 | if( isDelete ){ |
| 29701 | #if OS_VXWORKS |
| 29702 | zPath = zName; |
| 29703 | #else |
| 29704 | osUnlink(zName); |
| 29705 | #endif |
| 29706 | } |
| 29707 | #if SQLITE_ENABLE_LOCKING_STYLE |
| @@ -49189,20 +49207,20 @@ | |
| 49189 | ** |
| 49190 | ** After 5 RETRYs, we begin calling sqlite3OsSleep(). The first few |
| 49191 | ** calls to sqlite3OsSleep() have a delay of 1 microsecond. Really this |
| 49192 | ** is more of a scheduler yield than an actual delay. But on the 10th |
| 49193 | ** an subsequent retries, the delays start becoming longer and longer, |
| 49194 | ** so that on the 100th (and last) RETRY we delay for 21 milliseconds. |
| 49195 | ** The total delay time before giving up is less than 1 second. |
| 49196 | */ |
| 49197 | if( cnt>5 ){ |
| 49198 | int nDelay = 1; /* Pause time in microseconds */ |
| 49199 | if( cnt>100 ){ |
| 49200 | VVA_ONLY( pWal->lockError = 1; ) |
| 49201 | return SQLITE_PROTOCOL; |
| 49202 | } |
| 49203 | if( cnt>=10 ) nDelay = (cnt-9)*238; /* Max delay 21ms. Total delay 996ms */ |
| 49204 | sqlite3OsSleep(pWal->pVfs, nDelay); |
| 49205 | } |
| 49206 | |
| 49207 | if( !useWal ){ |
| 49208 | rc = walIndexReadHdr(pWal, pChanged); |
| @@ -61582,10 +61600,72 @@ | |
| 61582 | FuncDef *aFunc = (FuncDef*)&GLOBAL(FuncDef, aAnalyzeTableFuncs); |
| 61583 | for(i=0; i<ArraySize(aAnalyzeTableFuncs); i++){ |
| 61584 | sqlite3FuncDefInsert(pHash, &aFunc[i]); |
| 61585 | } |
| 61586 | } |
| 61587 | |
| 61588 | /* |
| 61589 | ** This function is used to allocate and populate UnpackedRecord |
| 61590 | ** structures intended to be compared against sample index keys stored |
| 61591 | ** in the sqlite_stat4 table. |
| @@ -61622,52 +61702,90 @@ | |
| 61622 | Expr *pExpr, /* The expression to extract a value from */ |
| 61623 | u8 affinity, /* Affinity to use */ |
| 61624 | int iVal, /* Array element to populate */ |
| 61625 | int *pbOk /* OUT: True if value was extracted */ |
| 61626 | ){ |
| 61627 | int rc = SQLITE_OK; |
| 61628 | sqlite3_value *pVal = 0; |
| 61629 | sqlite3 *db = pParse->db; |
| 61630 | |
| 61631 | |
| 61632 | struct ValueNewStat4Ctx alloc; |
| 61633 | alloc.pParse = pParse; |
| 61634 | alloc.pIdx = pIdx; |
| 61635 | alloc.ppRec = ppRec; |
| 61636 | alloc.iVal = iVal; |
| 61637 | |
| 61638 | /* Skip over any TK_COLLATE nodes */ |
| 61639 | pExpr = sqlite3ExprSkipCollate(pExpr); |
| 61640 | |
| 61641 | if( !pExpr ){ |
| 61642 | pVal = valueNew(db, &alloc); |
| 61643 | if( pVal ){ |
| 61644 | sqlite3VdbeMemSetNull((Mem*)pVal); |
| 61645 | } |
| 61646 | }else if( pExpr->op==TK_VARIABLE |
| 61647 | || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE) |
| 61648 | ){ |
| 61649 | Vdbe *v; |
| 61650 | int iBindVar = pExpr->iColumn; |
| 61651 | sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar); |
| 61652 | if( (v = pParse->pReprepare)!=0 ){ |
| 61653 | pVal = valueNew(db, &alloc); |
| 61654 | if( pVal ){ |
| 61655 | rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]); |
| 61656 | if( rc==SQLITE_OK ){ |
| 61657 | sqlite3ValueApplyAffinity(pVal, affinity, ENC(db)); |
| 61658 | } |
| 61659 | pVal->db = pParse->db; |
| 61660 | } |
| 61661 | } |
| 61662 | }else{ |
| 61663 | rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, &alloc); |
| 61664 | } |
| 61665 | *pbOk = (pVal!=0); |
| 61666 | |
| 61667 | assert( pVal==0 || pVal->db==db ); |
| 61668 | return rc; |
| 61669 | } |
| 61670 | |
| 61671 | /* |
| 61672 | ** Unless it is NULL, the argument must be an UnpackedRecord object returned |
| 61673 | ** by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes |
| @@ -65315,10 +65433,11 @@ | |
| 65315 | /* rc==0 here means that one or both of the keys ran out of fields and |
| 65316 | ** all the fields up to that point were equal. Return the the default_rc |
| 65317 | ** value. */ |
| 65318 | assert( CORRUPT_DB |
| 65319 | || pPKey2->default_rc==vdbeRecordCompareDebug(nKey1, pKey1, pPKey2) |
| 65320 | ); |
| 65321 | return pPKey2->default_rc; |
| 65322 | } |
| 65323 | |
| 65324 | /* |
| @@ -65480,10 +65599,11 @@ | |
| 65480 | |
| 65481 | assert( (res==0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)==0) |
| 65482 | || (res<0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)<0) |
| 65483 | || (res>0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)>0) |
| 65484 | || CORRUPT_DB |
| 65485 | ); |
| 65486 | return res; |
| 65487 | } |
| 65488 | |
| 65489 | /* |
| @@ -76853,11 +76973,12 @@ | |
| 76853 | }else{ |
| 76854 | /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to |
| 76855 | ** likelihood(X, 0.0625). |
| 76856 | ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for |
| 76857 | ** likelihood(X,0.0625). */ |
| 76858 | pExpr->iTable = 62; /* TUNING: Default 2nd arg to unlikely() is 0.0625 */ |
| 76859 | } |
| 76860 | } |
| 76861 | } |
| 76862 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 76863 | if( pDef ){ |
| @@ -77629,11 +77750,11 @@ | |
| 77629 | ** SELECT * FROM t1 WHERE (select a from t1); |
| 77630 | */ |
| 77631 | SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ |
| 77632 | int op; |
| 77633 | pExpr = sqlite3ExprSkipCollate(pExpr); |
| 77634 | if( pExpr->flags & EP_Generic ) return SQLITE_AFF_NONE; |
| 77635 | op = pExpr->op; |
| 77636 | if( op==TK_SELECT ){ |
| 77637 | assert( pExpr->flags&EP_xIsSelect ); |
| 77638 | return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); |
| 77639 | } |
| @@ -82929,10 +83050,11 @@ | |
| 82929 | /* Open the sqlite_stat[134] tables for writing. */ |
| 82930 | for(i=0; aTable[i].zCols; i++){ |
| 82931 | assert( i<ArraySize(aTable) ); |
| 82932 | sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3); |
| 82933 | sqlite3VdbeChangeP5(v, aCreateTbl[i]); |
| 82934 | } |
| 82935 | } |
| 82936 | |
| 82937 | /* |
| 82938 | ** Recommended number of samples for sqlite_stat4 |
| @@ -82964,11 +83086,12 @@ | |
| 82964 | #endif |
| 82965 | }; |
| 82966 | struct Stat4Accum { |
| 82967 | tRowcnt nRow; /* Number of rows in the entire table */ |
| 82968 | tRowcnt nPSample; /* How often to do a periodic sample */ |
| 82969 | int nCol; /* Number of columns in index + rowid */ |
| 82970 | int mxSample; /* Maximum number of samples to accumulate */ |
| 82971 | Stat4Sample current; /* Current row as a Stat4Sample */ |
| 82972 | u32 iPrn; /* Pseudo-random number used for sampling */ |
| 82973 | Stat4Sample *aBest; /* Array of nCol best samples */ |
| 82974 | int iMin; /* Index in a[] of entry with minimum score */ |
| @@ -83050,13 +83173,21 @@ | |
| 83050 | #endif |
| 83051 | sqlite3DbFree(p->db, p); |
| 83052 | } |
| 83053 | |
| 83054 | /* |
| 83055 | ** Implementation of the stat_init(N,C) SQL function. The two parameters |
| 83056 | ** are the number of rows in the table or index (C) and the number of columns |
| 83057 | ** in the index (N). The second argument (C) is only used for STAT3 and STAT4. |
| 83058 | ** |
| 83059 | ** This routine allocates the Stat4Accum object in heap memory. The return |
| 83060 | ** value is a pointer to the the Stat4Accum object encoded as a blob (i.e. |
| 83061 | ** the size of the blob is sizeof(void*) bytes). |
| 83062 | */ |
| @@ -83065,10 +83196,11 @@ | |
| 83065 | int argc, |
| 83066 | sqlite3_value **argv |
| 83067 | ){ |
| 83068 | Stat4Accum *p; |
| 83069 | int nCol; /* Number of columns in index being sampled */ |
| 83070 | int nColUp; /* nCol rounded up for alignment */ |
| 83071 | int n; /* Bytes of space to allocate */ |
| 83072 | sqlite3 *db; /* Database connection */ |
| 83073 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83074 | int mxSample = SQLITE_STAT4_SAMPLES; |
| @@ -83075,12 +83207,15 @@ | |
| 83075 | #endif |
| 83076 | |
| 83077 | /* Decode the three function arguments */ |
| 83078 | UNUSED_PARAMETER(argc); |
| 83079 | nCol = sqlite3_value_int(argv[0]); |
| 83080 | assert( nCol>1 ); /* >1 because it includes the rowid column */ |
| 83081 | nColUp = sizeof(tRowcnt)<8 ? (nCol+1)&~1 : nCol; |
| 83082 | |
| 83083 | /* Allocate the space required for the Stat4Accum object */ |
| 83084 | n = sizeof(*p) |
| 83085 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ |
| 83086 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ |
| @@ -83098,10 +83233,11 @@ | |
| 83098 | } |
| 83099 | |
| 83100 | p->db = db; |
| 83101 | p->nRow = 0; |
| 83102 | p->nCol = nCol; |
| 83103 | p->current.anDLt = (tRowcnt*)&p[1]; |
| 83104 | p->current.anEq = &p->current.anDLt[nColUp]; |
| 83105 | |
| 83106 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83107 | { |
| @@ -83108,13 +83244,13 @@ | |
| 83108 | u8 *pSpace; /* Allocated space not yet assigned */ |
| 83109 | int i; /* Used to iterate through p->aSample[] */ |
| 83110 | |
| 83111 | p->iGet = -1; |
| 83112 | p->mxSample = mxSample; |
| 83113 | p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[1])/(mxSample/3+1) + 1); |
| 83114 | p->current.anLt = &p->current.anEq[nColUp]; |
| 83115 | p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[1])*0xd0944565; |
| 83116 | |
| 83117 | /* Set up the Stat4Accum.a[] and aBest[] arrays */ |
| 83118 | p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; |
| 83119 | p->aBest = &p->a[mxSample]; |
| 83120 | pSpace = (u8*)(&p->a[mxSample+nCol]); |
| @@ -83133,11 +83269,11 @@ | |
| 83133 | |
| 83134 | /* Return a pointer to the allocated object to the caller */ |
| 83135 | sqlite3_result_blob(context, p, sizeof(p), stat4Destructor); |
| 83136 | } |
| 83137 | static const FuncDef statInitFuncdef = { |
| 83138 | 1+IsStat34, /* nArg */ |
| 83139 | SQLITE_UTF8, /* funcFlags */ |
| 83140 | 0, /* pUserData */ |
| 83141 | 0, /* pNext */ |
| 83142 | statInit, /* xFunc */ |
| 83143 | 0, /* xStep */ |
| @@ -83374,11 +83510,11 @@ | |
| 83374 | Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]); |
| 83375 | int iChng = sqlite3_value_int(argv[1]); |
| 83376 | |
| 83377 | UNUSED_PARAMETER( argc ); |
| 83378 | UNUSED_PARAMETER( context ); |
| 83379 | assert( p->nCol>1 ); /* Includes rowid field */ |
| 83380 | assert( iChng<p->nCol ); |
| 83381 | |
| 83382 | if( p->nRow==0 ){ |
| 83383 | /* This is the first call to this function. Do initialization. */ |
| 83384 | for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1; |
| @@ -83502,19 +83638,19 @@ | |
| 83502 | ** I = (K+D-1)/D |
| 83503 | */ |
| 83504 | char *z; |
| 83505 | int i; |
| 83506 | |
| 83507 | char *zRet = sqlite3MallocZero(p->nCol * 25); |
| 83508 | if( zRet==0 ){ |
| 83509 | sqlite3_result_error_nomem(context); |
| 83510 | return; |
| 83511 | } |
| 83512 | |
| 83513 | sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow); |
| 83514 | z = zRet + sqlite3Strlen30(zRet); |
| 83515 | for(i=0; i<(p->nCol-1); i++){ |
| 83516 | u64 nDistinct = p->current.anDLt[i] + 1; |
| 83517 | u64 iVal = (p->nRow + nDistinct - 1) / nDistinct; |
| 83518 | sqlite3_snprintf(24, z, " %llu", iVal); |
| 83519 | z += sqlite3Strlen30(z); |
| 83520 | assert( p->current.anEq[i] ); |
| @@ -83679,22 +83815,23 @@ | |
| 83679 | int addrNextRow; /* Address of "next_row:" */ |
| 83680 | const char *zIdxName; /* Name of the index */ |
| 83681 | |
| 83682 | if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
| 83683 | if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0; |
| 83684 | VdbeNoopComment((v, "Begin analysis of %s", pIdx->zName)); |
| 83685 | nCol = pIdx->nKeyCol; |
| 83686 | aGotoChng = sqlite3DbMallocRaw(db, sizeof(int)*(nCol+1)); |
| 83687 | if( aGotoChng==0 ) continue; |
| 83688 | |
| 83689 | /* Populate the register containing the index name. */ |
| 83690 | if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
| 83691 | zIdxName = pTab->zName; |
| 83692 | }else{ |
| 83693 | zIdxName = pIdx->zName; |
| 83694 | } |
| 83695 | sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, zIdxName, 0); |
| 83696 | |
| 83697 | /* |
| 83698 | ** Pseudo-code for loop that calls stat_push(): |
| 83699 | ** |
| 83700 | ** Rewind csr |
| @@ -83744,16 +83881,17 @@ | |
| 83744 | ** (2) the number of rows in the index, |
| 83745 | ** |
| 83746 | ** The second argument is only used for STAT3 and STAT4 |
| 83747 | */ |
| 83748 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83749 | sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+2); |
| 83750 | #endif |
| 83751 | sqlite3VdbeAddOp2(v, OP_Integer, nCol+1, regStat4+1); |
| 83752 | sqlite3VdbeAddOp3(v, OP_Function, 0, regStat4+1, regStat4); |
| 83753 | sqlite3VdbeChangeP4(v, -1, (char*)&statInitFuncdef, P4_FUNCDEF); |
| 83754 | sqlite3VdbeChangeP5(v, 1+IsStat34); |
| 83755 | |
| 83756 | /* Implementation of the following: |
| 83757 | ** |
| 83758 | ** Rewind csr |
| 83759 | ** if eof(csr) goto end_of_scan; |
| @@ -83851,11 +83989,11 @@ | |
| 83851 | int regSampleRowid = regCol + nCol; |
| 83852 | int addrNext; |
| 83853 | int addrIsNull; |
| 83854 | u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound; |
| 83855 | |
| 83856 | pParse->nMem = MAX(pParse->nMem, regCol+nCol+1); |
| 83857 | |
| 83858 | addrNext = sqlite3VdbeCurrentAddr(v); |
| 83859 | callStatGet(v, regStat4, STAT_GET_ROWID, regSampleRowid); |
| 83860 | addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid); |
| 83861 | VdbeCoverage(v); |
| @@ -83873,11 +84011,11 @@ | |
| 83873 | #else |
| 83874 | for(i=0; i<nCol; i++){ |
| 83875 | i16 iCol = pIdx->aiColumn[i]; |
| 83876 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i); |
| 83877 | } |
| 83878 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample); |
| 83879 | #endif |
| 83880 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp); |
| 83881 | sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid); |
| 83882 | sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid); |
| 83883 | sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */ |
| @@ -84185,11 +84323,20 @@ | |
| 84185 | static void initAvgEq(Index *pIdx){ |
| 84186 | if( pIdx ){ |
| 84187 | IndexSample *aSample = pIdx->aSample; |
| 84188 | IndexSample *pFinal = &aSample[pIdx->nSample-1]; |
| 84189 | int iCol; |
| 84190 | for(iCol=0; iCol<pIdx->nKeyCol; iCol++){ |
| 84191 | int i; /* Used to iterate through samples */ |
| 84192 | tRowcnt sumEq = 0; /* Sum of the nEq values */ |
| 84193 | tRowcnt nSum = 0; /* Number of terms contributing to sumEq */ |
| 84194 | tRowcnt avgEq = 0; |
| 84195 | tRowcnt nDLt = pFinal->anDLt[iCol]; |
| @@ -84208,11 +84355,10 @@ | |
| 84208 | if( nDLt>nSum ){ |
| 84209 | avgEq = (pFinal->anLt[iCol] - sumEq)/(nDLt - nSum); |
| 84210 | } |
| 84211 | if( avgEq==0 ) avgEq = 1; |
| 84212 | pIdx->aAvgEq[iCol] = avgEq; |
| 84213 | if( pIdx->nSampleCol==1 ) break; |
| 84214 | } |
| 84215 | } |
| 84216 | } |
| 84217 | |
| 84218 | /* |
| @@ -84267,11 +84413,10 @@ | |
| 84267 | sqlite3DbFree(db, zSql); |
| 84268 | if( rc ) return rc; |
| 84269 | |
| 84270 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 84271 | int nIdxCol = 1; /* Number of columns in stat4 records */ |
| 84272 | int nAvgCol = 1; /* Number of entries in Index.aAvgEq */ |
| 84273 | |
| 84274 | char *zIndex; /* Index name */ |
| 84275 | Index *pIdx; /* Pointer to the index object */ |
| 84276 | int nSample; /* Number of samples */ |
| 84277 | int nByte; /* Bytes of space required */ |
| @@ -84285,25 +84430,29 @@ | |
| 84285 | assert( pIdx==0 || bStat3 || pIdx->nSample==0 ); |
| 84286 | /* Index.nSample is non-zero at this point if data has already been |
| 84287 | ** loaded from the stat4 table. In this case ignore stat3 data. */ |
| 84288 | if( pIdx==0 || pIdx->nSample ) continue; |
| 84289 | if( bStat3==0 ){ |
| 84290 | nIdxCol = pIdx->nKeyCol+1; |
| 84291 | nAvgCol = pIdx->nKeyCol; |
| 84292 | } |
| 84293 | pIdx->nSampleCol = nIdxCol; |
| 84294 | nByte = sizeof(IndexSample) * nSample; |
| 84295 | nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample; |
| 84296 | nByte += nAvgCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */ |
| 84297 | |
| 84298 | pIdx->aSample = sqlite3DbMallocZero(db, nByte); |
| 84299 | if( pIdx->aSample==0 ){ |
| 84300 | sqlite3_finalize(pStmt); |
| 84301 | return SQLITE_NOMEM; |
| 84302 | } |
| 84303 | pSpace = (tRowcnt*)&pIdx->aSample[nSample]; |
| 84304 | pIdx->aAvgEq = pSpace; pSpace += nAvgCol; |
| 84305 | for(i=0; i<nSample; i++){ |
| 84306 | pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol; |
| 84307 | pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol; |
| 84308 | pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol; |
| 84309 | } |
| @@ -92553,10 +92702,11 @@ | |
| 92553 | FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92554 | FUNCTION(hex, 1, 0, 0, hexFunc ), |
| 92555 | FUNCTION2(ifnull, 2, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92556 | FUNCTION2(unlikely, 1, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92557 | FUNCTION2(likelihood, 2, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92558 | VFUNCTION(random, 0, 0, 0, randomFunc ), |
| 92559 | VFUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 92560 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 92561 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 92562 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| @@ -110581,11 +110731,11 @@ | |
| 110581 | pScan->pOrigWC = pWC; |
| 110582 | pScan->pWC = pWC; |
| 110583 | if( pIdx && iColumn>=0 ){ |
| 110584 | pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity; |
| 110585 | for(j=0; pIdx->aiColumn[j]!=iColumn; j++){ |
| 110586 | if( NEVER(j>=pIdx->nKeyCol) ) return 0; |
| 110587 | } |
| 110588 | pScan->zCollName = pIdx->azColl[j]; |
| 110589 | }else{ |
| 110590 | pScan->idxaff = 0; |
| 110591 | pScan->zCollName = 0; |
| @@ -111531,12 +111681,11 @@ | |
| 111531 | |
| 111532 | /* |
| 111533 | ** Estimate the logarithm of the input value to base 2. |
| 111534 | */ |
| 111535 | static LogEst estLog(LogEst N){ |
| 111536 | LogEst x = sqlite3LogEst(N); |
| 111537 | return x>33 ? x - 33 : 0; |
| 111538 | } |
| 111539 | |
| 111540 | /* |
| 111541 | ** Two routines for printing the content of an sqlite3_index_info |
| 111542 | ** structure. Used for testing and debugging only. If neither |
| @@ -111997,11 +112146,11 @@ | |
| 111997 | }else{ |
| 111998 | i64 nRow0 = sqlite3LogEstToInt(pIdx->aiRowLogEst[0]); |
| 111999 | iUpper = i>=pIdx->nSample ? nRow0 : aSample[i].anLt[iCol]; |
| 112000 | iLower = aSample[i-1].anEq[iCol] + aSample[i-1].anLt[iCol]; |
| 112001 | } |
| 112002 | aStat[1] = (pIdx->nKeyCol>iCol ? pIdx->aAvgEq[iCol] : 1); |
| 112003 | if( iLower>=iUpper ){ |
| 112004 | iGap = 0; |
| 112005 | }else{ |
| 112006 | iGap = iUpper - iLower; |
| 112007 | } |
| @@ -112036,10 +112185,118 @@ | |
| 112036 | } |
| 112037 | } |
| 112038 | return nRet; |
| 112039 | } |
| 112040 | |
| 112041 | /* |
| 112042 | ** This function is used to estimate the number of rows that will be visited |
| 112043 | ** by scanning an index for a range of values. The range may have an upper |
| 112044 | ** bound, a lower bound, or both. The WHERE clause terms that set the upper |
| 112045 | ** and lower bounds are represented by pLower and pUpper respectively. For |
| @@ -112072,13 +112329,13 @@ | |
| 112072 | ** considering the range constraints. If nEq is 0, this is the number of |
| 112073 | ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) |
| 112074 | ** to account for the range contraints pLower and pUpper. |
| 112075 | ** |
| 112076 | ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be |
| 112077 | ** used, each range inequality reduces the search space by a factor of 4. |
| 112078 | ** Hence a pair of constraints (x>? AND x<?) reduces the expected number of |
| 112079 | ** rows visited by a factor of 16. |
| 112080 | */ |
| 112081 | static int whereRangeScanEst( |
| 112082 | Parse *pParse, /* Parsing & code generating context */ |
| 112083 | WhereLoopBuilder *pBuilder, |
| 112084 | WhereTerm *pLower, /* Lower bound on the range. ex: "x>123" Might be NULL */ |
| @@ -112092,99 +112349,104 @@ | |
| 112092 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 112093 | Index *p = pLoop->u.btree.pIndex; |
| 112094 | int nEq = pLoop->u.btree.nEq; |
| 112095 | |
| 112096 | if( p->nSample>0 |
| 112097 | && nEq==pBuilder->nRecValid |
| 112098 | && nEq<p->nSampleCol |
| 112099 | && OptimizationEnabled(pParse->db, SQLITE_Stat3) |
| 112100 | ){ |
| 112101 | UnpackedRecord *pRec = pBuilder->pRec; |
| 112102 | tRowcnt a[2]; |
| 112103 | u8 aff; |
| 112104 | |
| 112105 | /* Variable iLower will be set to the estimate of the number of rows in |
| 112106 | ** the index that are less than the lower bound of the range query. The |
| 112107 | ** lower bound being the concatenation of $P and $L, where $P is the |
| 112108 | ** key-prefix formed by the nEq values matched against the nEq left-most |
| 112109 | ** columns of the index, and $L is the value in pLower. |
| 112110 | ** |
| 112111 | ** Or, if pLower is NULL or $L cannot be extracted from it (because it |
| 112112 | ** is not a simple variable or literal value), the lower bound of the |
| 112113 | ** range is $P. Due to a quirk in the way whereKeyStats() works, even |
| 112114 | ** if $L is available, whereKeyStats() is called for both ($P) and |
| 112115 | ** ($P:$L) and the larger of the two returned values used. |
| 112116 | ** |
| 112117 | ** Similarly, iUpper is to be set to the estimate of the number of rows |
| 112118 | ** less than the upper bound of the range query. Where the upper bound |
| 112119 | ** is either ($P) or ($P:$U). Again, even if $U is available, both values |
| 112120 | ** of iUpper are requested of whereKeyStats() and the smaller used. |
| 112121 | */ |
| 112122 | tRowcnt iLower; |
| 112123 | tRowcnt iUpper; |
| 112124 | |
| 112125 | if( nEq==p->nKeyCol ){ |
| 112126 | aff = SQLITE_AFF_INTEGER; |
| 112127 | }else{ |
| 112128 | aff = p->pTable->aCol[p->aiColumn[nEq]].affinity; |
| 112129 | } |
| 112130 | /* Determine iLower and iUpper using ($P) only. */ |
| 112131 | if( nEq==0 ){ |
| 112132 | iLower = 0; |
| 112133 | iUpper = sqlite3LogEstToInt(p->aiRowLogEst[0]); |
| 112134 | }else{ |
| 112135 | /* Note: this call could be optimized away - since the same values must |
| 112136 | ** have been requested when testing key $P in whereEqualScanEst(). */ |
| 112137 | whereKeyStats(pParse, p, pRec, 0, a); |
| 112138 | iLower = a[0]; |
| 112139 | iUpper = a[0] + a[1]; |
| 112140 | } |
| 112141 | |
| 112142 | /* If possible, improve on the iLower estimate using ($P:$L). */ |
| 112143 | if( pLower ){ |
| 112144 | int bOk; /* True if value is extracted from pExpr */ |
| 112145 | Expr *pExpr = pLower->pExpr->pRight; |
| 112146 | assert( (pLower->eOperator & (WO_GT|WO_GE))!=0 ); |
| 112147 | rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); |
| 112148 | if( rc==SQLITE_OK && bOk ){ |
| 112149 | tRowcnt iNew; |
| 112150 | whereKeyStats(pParse, p, pRec, 0, a); |
| 112151 | iNew = a[0] + ((pLower->eOperator & WO_GT) ? a[1] : 0); |
| 112152 | if( iNew>iLower ) iLower = iNew; |
| 112153 | nOut--; |
| 112154 | } |
| 112155 | } |
| 112156 | |
| 112157 | /* If possible, improve on the iUpper estimate using ($P:$U). */ |
| 112158 | if( pUpper ){ |
| 112159 | int bOk; /* True if value is extracted from pExpr */ |
| 112160 | Expr *pExpr = pUpper->pExpr->pRight; |
| 112161 | assert( (pUpper->eOperator & (WO_LT|WO_LE))!=0 ); |
| 112162 | rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); |
| 112163 | if( rc==SQLITE_OK && bOk ){ |
| 112164 | tRowcnt iNew; |
| 112165 | whereKeyStats(pParse, p, pRec, 1, a); |
| 112166 | iNew = a[0] + ((pUpper->eOperator & WO_LE) ? a[1] : 0); |
| 112167 | if( iNew<iUpper ) iUpper = iNew; |
| 112168 | nOut--; |
| 112169 | } |
| 112170 | } |
| 112171 | |
| 112172 | pBuilder->pRec = pRec; |
| 112173 | if( rc==SQLITE_OK ){ |
| 112174 | if( iUpper>iLower ){ |
| 112175 | nNew = sqlite3LogEst(iUpper - iLower); |
| 112176 | }else{ |
| 112177 | nNew = 10; assert( 10==sqlite3LogEst(2) ); |
| 112178 | } |
| 112179 | if( nNew<nOut ){ |
| 112180 | nOut = nNew; |
| 112181 | } |
| 112182 | pLoop->nOut = (LogEst)nOut; |
| 112183 | WHERETRACE(0x10, ("range scan regions: %u..%u est=%d\n", |
| 112184 | (u32)iLower, (u32)iUpper, nOut)); |
| 112185 | return SQLITE_OK; |
| 112186 | } |
| 112187 | } |
| 112188 | #else |
| 112189 | UNUSED_PARAMETER(pParse); |
| 112190 | UNUSED_PARAMETER(pBuilder); |
| @@ -112239,11 +112501,11 @@ | |
| 112239 | int rc; /* Subfunction return code */ |
| 112240 | tRowcnt a[2]; /* Statistics */ |
| 112241 | int bOk; |
| 112242 | |
| 112243 | assert( nEq>=1 ); |
| 112244 | assert( nEq<=(p->nKeyCol+1) ); |
| 112245 | assert( p->aSample!=0 ); |
| 112246 | assert( p->nSample>0 ); |
| 112247 | assert( pBuilder->nRecValid<nEq ); |
| 112248 | |
| 112249 | /* If values are not available for all fields of the index to the left |
| @@ -112252,11 +112514,11 @@ | |
| 112252 | return SQLITE_NOTFOUND; |
| 112253 | } |
| 112254 | |
| 112255 | /* This is an optimization only. The call to sqlite3Stat4ProbeSetValue() |
| 112256 | ** below would return the same value. */ |
| 112257 | if( nEq>p->nKeyCol ){ |
| 112258 | *pnRow = 1; |
| 112259 | return SQLITE_OK; |
| 112260 | } |
| 112261 | |
| 112262 | aff = p->pTable->aCol[p->aiColumn[nEq-1]].affinity; |
| @@ -112683,11 +112945,11 @@ | |
| 112683 | } |
| 112684 | sqlite3StrAccumInit(&txt, 0, 0, SQLITE_MAX_LENGTH); |
| 112685 | txt.db = db; |
| 112686 | sqlite3StrAccumAppend(&txt, " (", 2); |
| 112687 | for(i=0; i<nEq; i++){ |
| 112688 | char *z = (i==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[i]].zName; |
| 112689 | if( i>=nSkip ){ |
| 112690 | explainAppendTerm(&txt, i, z, "="); |
| 112691 | }else{ |
| 112692 | if( i ) sqlite3StrAccumAppend(&txt, " AND ", 5); |
| 112693 | sqlite3StrAccumAppend(&txt, "ANY(", 4); |
| @@ -112696,15 +112958,15 @@ | |
| 112696 | } |
| 112697 | } |
| 112698 | |
| 112699 | j = i; |
| 112700 | if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ |
| 112701 | char *z = (j==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[j]].zName; |
| 112702 | explainAppendTerm(&txt, i++, z, ">"); |
| 112703 | } |
| 112704 | if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ |
| 112705 | char *z = (j==pIndex->nKeyCol ) ? "rowid" : aCol[aiColumn[j]].zName; |
| 112706 | explainAppendTerm(&txt, i, z, "<"); |
| 112707 | } |
| 112708 | sqlite3StrAccumAppend(&txt, ")", 1); |
| 112709 | return sqlite3StrAccumFinish(&txt); |
| 112710 | } |
| @@ -113724,11 +113986,11 @@ | |
| 113724 | z = sqlite3_mprintf("(%d,%x)", p->u.vtab.idxNum, p->u.vtab.omitMask); |
| 113725 | } |
| 113726 | sqlite3DebugPrintf(" %-19s", z); |
| 113727 | sqlite3_free(z); |
| 113728 | } |
| 113729 | sqlite3DebugPrintf(" f %04x N %d", p->wsFlags, p->nLTerm); |
| 113730 | sqlite3DebugPrintf(" cost %d,%d,%d\n", p->rSetup, p->rRun, p->nOut); |
| 113731 | #ifdef SQLITE_ENABLE_TREE_EXPLAIN |
| 113732 | /* If the 0x100 bit of wheretracing is set, then show all of the constraint |
| 113733 | ** expressions in the WhereLoop.aLTerm[] array. |
| 113734 | */ |
| @@ -113960,10 +114222,21 @@ | |
| 113960 | |
| 113961 | /* whereLoopAddBtree() always generates and inserts the automatic index |
| 113962 | ** case first. Hence compatible candidate WhereLoops never have a larger |
| 113963 | ** rSetup. Call this SETUP-INVARIANT */ |
| 113964 | assert( p->rSetup>=pTemplate->rSetup ); |
| 113965 | |
| 113966 | /* If existing WhereLoop p is better than pTemplate, pTemplate can be |
| 113967 | ** discarded. WhereLoop p is better if: |
| 113968 | ** (1) p has no more dependencies than pTemplate, and |
| 113969 | ** (2) p has an equal or lower cost than pTemplate |
| @@ -114085,17 +114358,17 @@ | |
| 114085 | ** p[] that are also supplated by pTemplate */ |
| 114086 | WhereLoop **ppTail = &p->pNextLoop; |
| 114087 | WhereLoop *pToDel; |
| 114088 | while( *ppTail ){ |
| 114089 | ppTail = whereLoopFindLesser(ppTail, pTemplate); |
| 114090 | if( NEVER(ppTail==0) ) break; |
| 114091 | pToDel = *ppTail; |
| 114092 | if( pToDel==0 ) break; |
| 114093 | *ppTail = pToDel->pNextLoop; |
| 114094 | #if WHERETRACE_ENABLED /* 0x8 */ |
| 114095 | if( sqlite3WhereTrace & 0x8 ){ |
| 114096 | sqlite3DebugPrintf("ins-del: "); |
| 114097 | whereLoopPrint(pToDel, pBuilder->pWC); |
| 114098 | } |
| 114099 | #endif |
| 114100 | whereLoopDelete(db, pToDel); |
| 114101 | } |
| @@ -114191,16 +114464,13 @@ | |
| 114191 | }else{ |
| 114192 | opMask = WO_EQ|WO_IN|WO_ISNULL|WO_GT|WO_GE|WO_LT|WO_LE; |
| 114193 | } |
| 114194 | if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); |
| 114195 | |
| 114196 | assert( pNew->u.btree.nEq<=pProbe->nKeyCol ); |
| 114197 | if( pNew->u.btree.nEq < pProbe->nKeyCol ){ |
| 114198 | iCol = pProbe->aiColumn[pNew->u.btree.nEq]; |
| 114199 | }else{ |
| 114200 | iCol = -1; |
| 114201 | } |
| 114202 | pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, iCol, |
| 114203 | opMask, pProbe); |
| 114204 | saved_nEq = pNew->u.btree.nEq; |
| 114205 | saved_nSkip = pNew->u.btree.nSkip; |
| 114206 | saved_nLTerm = pNew->nLTerm; |
| @@ -114386,11 +114656,11 @@ | |
| 114386 | }else{ |
| 114387 | pNew->nOut = nOutUnadjusted; |
| 114388 | } |
| 114389 | |
| 114390 | if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 |
| 114391 | && pNew->u.btree.nEq<(pProbe->nKeyCol + (pProbe->zName!=0)) |
| 114392 | ){ |
| 114393 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn); |
| 114394 | } |
| 114395 | pNew->nOut = saved_nOut; |
| 114396 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| @@ -114533,10 +114803,11 @@ | |
| 114533 | ** fake index the first in a chain of Index objects with all of the real |
| 114534 | ** indices to follow */ |
| 114535 | Index *pFirst; /* First of real indices on the table */ |
| 114536 | memset(&sPk, 0, sizeof(Index)); |
| 114537 | sPk.nKeyCol = 1; |
| 114538 | sPk.aiColumn = &aiColumnPk; |
| 114539 | sPk.aiRowLogEst = aiRowEstPk; |
| 114540 | sPk.onError = OE_Replace; |
| 114541 | sPk.pTable = pTab; |
| 114542 | sPk.szIdxRow = pTab->szTabRow; |
| @@ -115316,11 +115587,10 @@ | |
| 115316 | int mxI = 0; /* Index of next entry to replace */ |
| 115317 | int nOrderBy; /* Number of ORDER BY clause terms */ |
| 115318 | LogEst rCost; /* Cost of a path */ |
| 115319 | LogEst nOut; /* Number of outputs */ |
| 115320 | LogEst mxCost = 0; /* Maximum cost of a set of paths */ |
| 115321 | LogEst mxOut = 0; /* Maximum nOut value on the set of paths */ |
| 115322 | int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */ |
| 115323 | WherePath *aFrom; /* All nFrom paths at the previous level */ |
| 115324 | WherePath *aTo; /* The nTo best paths at the current level */ |
| 115325 | WherePath *pFrom; /* An element of aFrom[] that we are working on */ |
| 115326 | WherePath *pTo; /* An element of aTo[] that we are working on */ |
| @@ -115426,12 +115696,10 @@ | |
| 115426 | } |
| 115427 | /* Check to see if pWLoop should be added to the mxChoice best so far */ |
| 115428 | for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){ |
| 115429 | if( pTo->maskLoop==maskNew |
| 115430 | && ((pTo->isOrdered^isOrdered)&80)==0 |
| 115431 | && ((pTo->rCost<=rCost && pTo->nRow<=nOut) || |
| 115432 | (pTo->rCost>=rCost && pTo->nRow>=nOut)) |
| 115433 | ){ |
| 115434 | testcase( jj==nTo-1 ); |
| 115435 | break; |
| 115436 | } |
| 115437 | } |
| @@ -115461,11 +115729,11 @@ | |
| 115461 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| 115462 | isOrdered>=0 ? isOrdered+'0' : '?'); |
| 115463 | } |
| 115464 | #endif |
| 115465 | }else{ |
| 115466 | if( pTo->rCost<=rCost && pTo->nRow<=nOut ){ |
| 115467 | #ifdef WHERETRACE_ENABLED /* 0x4 */ |
| 115468 | if( sqlite3WhereTrace&0x4 ){ |
| 115469 | sqlite3DebugPrintf( |
| 115470 | "Skip %s cost=%-3d,%3d order=%c", |
| 115471 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| @@ -115501,15 +115769,13 @@ | |
| 115501 | memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop); |
| 115502 | pTo->aLoop[iLoop] = pWLoop; |
| 115503 | if( nTo>=mxChoice ){ |
| 115504 | mxI = 0; |
| 115505 | mxCost = aTo[0].rCost; |
| 115506 | mxOut = aTo[0].nRow; |
| 115507 | for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){ |
| 115508 | if( pTo->rCost>mxCost || (pTo->rCost==mxCost && pTo->nRow>mxOut) ){ |
| 115509 | mxCost = pTo->rCost; |
| 115510 | mxOut = pTo->nRow; |
| 115511 | mxI = jj; |
| 115512 | } |
| 115513 | } |
| 115514 | } |
| 115515 | } |
| @@ -124205,14 +124471,14 @@ | |
| 124205 | ** sqlite3_test_control(). |
| 124206 | */ |
| 124207 | case SQLITE_TESTCTRL_FAULT_INSTALL: { |
| 124208 | /* MSVC is picky about pulling func ptrs from va lists. |
| 124209 | ** http://support.microsoft.com/kb/47961 |
| 124210 | ** sqlite3Config.xTestCallback = va_arg(ap, int(*)(int)); |
| 124211 | */ |
| 124212 | typedef int(*TESTCALLBACKFUNC_t)(int); |
| 124213 | sqlite3Config.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t); |
| 124214 | rc = sqlite3FaultSim(0); |
| 124215 | break; |
| 124216 | } |
| 124217 | |
| 124218 | /* |
| @@ -140777,38 +141043,40 @@ | |
| 140777 | i64 iDocid = sqlite3_column_int64(pStmt, 0); |
| 140778 | int iLang = langidFromSelect(p, pStmt); |
| 140779 | int iCol; |
| 140780 | |
| 140781 | for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){ |
| 140782 | const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); |
| 140783 | int nText = sqlite3_column_bytes(pStmt, iCol+1); |
| 140784 | sqlite3_tokenizer_cursor *pT = 0; |
| 140785 | |
| 140786 | rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText, &pT); |
| 140787 | while( rc==SQLITE_OK ){ |
| 140788 | char const *zToken; /* Buffer containing token */ |
| 140789 | int nToken = 0; /* Number of bytes in token */ |
| 140790 | int iDum1 = 0, iDum2 = 0; /* Dummy variables */ |
| 140791 | int iPos = 0; /* Position of token in zText */ |
| 140792 | |
| 140793 | rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); |
| 140794 | if( rc==SQLITE_OK ){ |
| 140795 | int i; |
| 140796 | cksum2 = cksum2 ^ fts3ChecksumEntry( |
| 140797 | zToken, nToken, iLang, 0, iDocid, iCol, iPos |
| 140798 | ); |
| 140799 | for(i=1; i<p->nIndex; i++){ |
| 140800 | if( p->aIndex[i].nPrefix<=nToken ){ |
| 140801 | cksum2 = cksum2 ^ fts3ChecksumEntry( |
| 140802 | zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos |
| 140803 | ); |
| 140804 | } |
| 140805 | } |
| 140806 | } |
| 140807 | } |
| 140808 | if( pT ) pModule->xClose(pT); |
| 140809 | if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
| 140810 | } |
| 140811 | } |
| 140812 | |
| 140813 | sqlite3_finalize(pStmt); |
| 140814 | } |
| 140815 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.8.6. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | |
| 220 | ** |
| 221 | ** See also: [sqlite3_libversion()], |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.6" |
| 226 | #define SQLITE_VERSION_NUMBER 3008006 |
| 227 | #define SQLITE_SOURCE_ID "2014-07-01 11:54:02 21981e35062cc6b30e9576786cbf55265a7a4d41" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -9479,10 +9479,11 @@ | |
| 9479 | SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8); |
| 9480 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 9481 | #ifndef SQLITE_OMIT_TRACE |
| 9482 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 9483 | #endif |
| 9484 | SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); |
| 9485 | |
| 9486 | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); |
| 9487 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*,int); |
| 9488 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); |
| 9489 | |
| @@ -12885,11 +12886,13 @@ | |
| 12886 | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); |
| 12887 | |
| 12888 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 12889 | SQLITE_PRIVATE void sqlite3AnalyzeFunctions(void); |
| 12890 | SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(Parse*,Index*,UnpackedRecord**,Expr*,u8,int,int*); |
| 12891 | SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr(Parse*, Expr*, u8, sqlite3_value**); |
| 12892 | SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord*); |
| 12893 | SQLITE_PRIVATE int sqlite3Stat4Column(sqlite3*, const void*, int, int, sqlite3_value**); |
| 12894 | #endif |
| 12895 | |
| 12896 | /* |
| 12897 | ** The interface to the LEMON-generated parser |
| 12898 | */ |
| @@ -14199,11 +14202,10 @@ | |
| 14202 | SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe*, int, int); |
| 14203 | |
| 14204 | int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); |
| 14205 | SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); |
| 14206 | SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); |
| 14207 | SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); |
| 14208 | SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); |
| 14209 | SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); |
| 14210 | SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int); |
| 14211 | SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*); |
| @@ -21562,12 +21564,12 @@ | |
| 21564 | ** * Bytes in the range of 0x80 through 0xbf which occur as the first |
| 21565 | ** byte of a character are interpreted as single-byte characters |
| 21566 | ** and rendered as themselves even though they are technically |
| 21567 | ** invalid characters. |
| 21568 | ** |
| 21569 | ** * This routine accepts over-length UTF8 encodings |
| 21570 | ** for unicode values 0x80 and greater. It does not change over-length |
| 21571 | ** encodings to 0xfffd as some systems recommend. |
| 21572 | */ |
| 21573 | #define READ_UTF8(zIn, zTerm, c) \ |
| 21574 | c = *(zIn++); \ |
| 21575 | if( c>=0xc0 ){ \ |
| @@ -24371,14 +24373,14 @@ | |
| 24373 | { "mremap", (sqlite3_syscall_ptr)mremap, 0 }, |
| 24374 | #else |
| 24375 | { "mremap", (sqlite3_syscall_ptr)0, 0 }, |
| 24376 | #endif |
| 24377 | #define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent) |
| 24378 | { "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 }, |
| 24379 | #define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent) |
| 24380 | |
| 24381 | #endif |
| 24382 | |
| 24383 | }; /* End of the overrideable system calls */ |
| 24384 | |
| 24385 | /* |
| 24386 | ** This is the xSetSystemCall() method of sqlite3_vfs for all of the |
| @@ -25844,10 +25846,17 @@ | |
| 25846 | osUnlink(pFile->pId->zCanonicalName); |
| 25847 | } |
| 25848 | vxworksReleaseFileId(pFile->pId); |
| 25849 | pFile->pId = 0; |
| 25850 | } |
| 25851 | #endif |
| 25852 | #ifdef SQLITE_UNLINK_AFTER_CLOSE |
| 25853 | if( pFile->ctrlFlags & UNIXFILE_DELETE ){ |
| 25854 | osUnlink(pFile->zPath); |
| 25855 | sqlite3_free(*(char**)&pFile->zPath); |
| 25856 | pFile->zPath = 0; |
| 25857 | } |
| 25858 | #endif |
| 25859 | OSTRACE(("CLOSE %-3d\n", pFile->h)); |
| 25860 | OpenCounter(-1); |
| 25861 | sqlite3_free(pFile->pUnused); |
| 25862 | memset(pFile, 0, sizeof(unixFile)); |
| @@ -27883,12 +27892,29 @@ | |
| 27892 | rc |= SQLITE_IOCAP_POWERSAFE_OVERWRITE; |
| 27893 | } |
| 27894 | return rc; |
| 27895 | } |
| 27896 | |
| 27897 | #if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 |
| 27898 | |
| 27899 | /* |
| 27900 | ** Return the system page size. |
| 27901 | ** |
| 27902 | ** This function should not be called directly by other code in this file. |
| 27903 | ** Instead, it should be called via macro osGetpagesize(). |
| 27904 | */ |
| 27905 | static int unixGetpagesize(void){ |
| 27906 | #if defined(_BSD_SOURCE) |
| 27907 | return getpagesize(); |
| 27908 | #else |
| 27909 | return (int)sysconf(_SC_PAGESIZE); |
| 27910 | #endif |
| 27911 | } |
| 27912 | |
| 27913 | #endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */ |
| 27914 | |
| 27915 | #ifndef SQLITE_OMIT_WAL |
| 27916 | |
| 27917 | /* |
| 27918 | ** Object used to represent an shared memory buffer. |
| 27919 | ** |
| 27920 | ** When multiple threads all reference the same wal-index, each thread |
| @@ -28035,24 +28061,10 @@ | |
| 28061 | #endif |
| 28062 | |
| 28063 | return rc; |
| 28064 | } |
| 28065 | |
| 28066 | /* |
| 28067 | ** Return the minimum number of 32KB shm regions that should be mapped at |
| 28068 | ** a time, assuming that each mapping must be an integer multiple of the |
| 28069 | ** current system page-size. |
| 28070 | ** |
| @@ -29698,10 +29710,16 @@ | |
| 29710 | } |
| 29711 | |
| 29712 | if( isDelete ){ |
| 29713 | #if OS_VXWORKS |
| 29714 | zPath = zName; |
| 29715 | #elif defined(SQLITE_UNLINK_AFTER_CLOSE) |
| 29716 | zPath = sqlite3_mprintf("%s", zName); |
| 29717 | if( zPath==0 ){ |
| 29718 | robust_close(p, fd, __LINE__); |
| 29719 | return SQLITE_NOMEM; |
| 29720 | } |
| 29721 | #else |
| 29722 | osUnlink(zName); |
| 29723 | #endif |
| 29724 | } |
| 29725 | #if SQLITE_ENABLE_LOCKING_STYLE |
| @@ -49189,20 +49207,20 @@ | |
| 49207 | ** |
| 49208 | ** After 5 RETRYs, we begin calling sqlite3OsSleep(). The first few |
| 49209 | ** calls to sqlite3OsSleep() have a delay of 1 microsecond. Really this |
| 49210 | ** is more of a scheduler yield than an actual delay. But on the 10th |
| 49211 | ** an subsequent retries, the delays start becoming longer and longer, |
| 49212 | ** so that on the 100th (and last) RETRY we delay for 323 milliseconds. |
| 49213 | ** The total delay time before giving up is less than 10 seconds. |
| 49214 | */ |
| 49215 | if( cnt>5 ){ |
| 49216 | int nDelay = 1; /* Pause time in microseconds */ |
| 49217 | if( cnt>100 ){ |
| 49218 | VVA_ONLY( pWal->lockError = 1; ) |
| 49219 | return SQLITE_PROTOCOL; |
| 49220 | } |
| 49221 | if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39; |
| 49222 | sqlite3OsSleep(pWal->pVfs, nDelay); |
| 49223 | } |
| 49224 | |
| 49225 | if( !useWal ){ |
| 49226 | rc = walIndexReadHdr(pWal, pChanged); |
| @@ -61582,10 +61600,72 @@ | |
| 61600 | FuncDef *aFunc = (FuncDef*)&GLOBAL(FuncDef, aAnalyzeTableFuncs); |
| 61601 | for(i=0; i<ArraySize(aAnalyzeTableFuncs); i++){ |
| 61602 | sqlite3FuncDefInsert(pHash, &aFunc[i]); |
| 61603 | } |
| 61604 | } |
| 61605 | |
| 61606 | /* |
| 61607 | ** Attempt to extract a value from pExpr and use it to construct *ppVal. |
| 61608 | ** |
| 61609 | ** If pAlloc is not NULL, then an UnpackedRecord object is created for |
| 61610 | ** pAlloc if one does not exist and the new value is added to the |
| 61611 | ** UnpackedRecord object. |
| 61612 | ** |
| 61613 | ** A value is extracted in the following cases: |
| 61614 | ** |
| 61615 | ** * (pExpr==0). In this case the value is assumed to be an SQL NULL, |
| 61616 | ** |
| 61617 | ** * The expression is a bound variable, and this is a reprepare, or |
| 61618 | ** |
| 61619 | ** * The expression is a literal value. |
| 61620 | ** |
| 61621 | ** On success, *ppVal is made to point to the extracted value. The caller |
| 61622 | ** is responsible for ensuring that the value is eventually freed. |
| 61623 | */ |
| 61624 | static int stat4ValueFromExpr( |
| 61625 | Parse *pParse, /* Parse context */ |
| 61626 | Expr *pExpr, /* The expression to extract a value from */ |
| 61627 | u8 affinity, /* Affinity to use */ |
| 61628 | struct ValueNewStat4Ctx *pAlloc,/* How to allocate space. Or NULL */ |
| 61629 | sqlite3_value **ppVal /* OUT: New value object (or NULL) */ |
| 61630 | ){ |
| 61631 | int rc = SQLITE_OK; |
| 61632 | sqlite3_value *pVal = 0; |
| 61633 | sqlite3 *db = pParse->db; |
| 61634 | |
| 61635 | /* Skip over any TK_COLLATE nodes */ |
| 61636 | pExpr = sqlite3ExprSkipCollate(pExpr); |
| 61637 | |
| 61638 | if( !pExpr ){ |
| 61639 | pVal = valueNew(db, pAlloc); |
| 61640 | if( pVal ){ |
| 61641 | sqlite3VdbeMemSetNull((Mem*)pVal); |
| 61642 | } |
| 61643 | }else if( pExpr->op==TK_VARIABLE |
| 61644 | || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE) |
| 61645 | ){ |
| 61646 | Vdbe *v; |
| 61647 | int iBindVar = pExpr->iColumn; |
| 61648 | sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar); |
| 61649 | if( (v = pParse->pReprepare)!=0 ){ |
| 61650 | pVal = valueNew(db, pAlloc); |
| 61651 | if( pVal ){ |
| 61652 | rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]); |
| 61653 | if( rc==SQLITE_OK ){ |
| 61654 | sqlite3ValueApplyAffinity(pVal, affinity, ENC(db)); |
| 61655 | } |
| 61656 | pVal->db = pParse->db; |
| 61657 | } |
| 61658 | } |
| 61659 | }else{ |
| 61660 | rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc); |
| 61661 | } |
| 61662 | |
| 61663 | assert( pVal==0 || pVal->db==db ); |
| 61664 | *ppVal = pVal; |
| 61665 | return rc; |
| 61666 | } |
| 61667 | |
| 61668 | /* |
| 61669 | ** This function is used to allocate and populate UnpackedRecord |
| 61670 | ** structures intended to be compared against sample index keys stored |
| 61671 | ** in the sqlite_stat4 table. |
| @@ -61622,52 +61702,90 @@ | |
| 61702 | Expr *pExpr, /* The expression to extract a value from */ |
| 61703 | u8 affinity, /* Affinity to use */ |
| 61704 | int iVal, /* Array element to populate */ |
| 61705 | int *pbOk /* OUT: True if value was extracted */ |
| 61706 | ){ |
| 61707 | int rc; |
| 61708 | sqlite3_value *pVal = 0; |
| 61709 | struct ValueNewStat4Ctx alloc; |
| 61710 | |
| 61711 | alloc.pParse = pParse; |
| 61712 | alloc.pIdx = pIdx; |
| 61713 | alloc.ppRec = ppRec; |
| 61714 | alloc.iVal = iVal; |
| 61715 | |
| 61716 | rc = stat4ValueFromExpr(pParse, pExpr, affinity, &alloc, &pVal); |
| 61717 | assert( pVal==0 || pVal->db==pParse->db ); |
| 61718 | *pbOk = (pVal!=0); |
| 61719 | return rc; |
| 61720 | } |
| 61721 | |
| 61722 | /* |
| 61723 | ** Attempt to extract a value from expression pExpr using the methods |
| 61724 | ** as described for sqlite3Stat4ProbeSetValue() above. |
| 61725 | ** |
| 61726 | ** If successful, set *ppVal to point to a new value object and return |
| 61727 | ** SQLITE_OK. If no value can be extracted, but no other error occurs |
| 61728 | ** (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error |
| 61729 | ** does occur, return an SQLite error code. The final value of *ppVal |
| 61730 | ** is undefined in this case. |
| 61731 | */ |
| 61732 | SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr( |
| 61733 | Parse *pParse, /* Parse context */ |
| 61734 | Expr *pExpr, /* The expression to extract a value from */ |
| 61735 | u8 affinity, /* Affinity to use */ |
| 61736 | sqlite3_value **ppVal /* OUT: New value object (or NULL) */ |
| 61737 | ){ |
| 61738 | return stat4ValueFromExpr(pParse, pExpr, affinity, 0, ppVal); |
| 61739 | } |
| 61740 | |
| 61741 | /* |
| 61742 | ** Extract the iCol-th column from the nRec-byte record in pRec. Write |
| 61743 | ** the column value into *ppVal. If *ppVal is initially NULL then a new |
| 61744 | ** sqlite3_value object is allocated. |
| 61745 | ** |
| 61746 | ** If *ppVal is initially NULL then the caller is responsible for |
| 61747 | ** ensuring that the value written into *ppVal is eventually freed. |
| 61748 | */ |
| 61749 | SQLITE_PRIVATE int sqlite3Stat4Column( |
| 61750 | sqlite3 *db, /* Database handle */ |
| 61751 | const void *pRec, /* Pointer to buffer containing record */ |
| 61752 | int nRec, /* Size of buffer pRec in bytes */ |
| 61753 | int iCol, /* Column to extract */ |
| 61754 | sqlite3_value **ppVal /* OUT: Extracted value */ |
| 61755 | ){ |
| 61756 | u32 t; /* a column type code */ |
| 61757 | int nHdr; /* Size of the header in the record */ |
| 61758 | int iHdr; /* Next unread header byte */ |
| 61759 | int iField; /* Next unread data byte */ |
| 61760 | int szField; /* Size of the current data field */ |
| 61761 | int i; /* Column index */ |
| 61762 | u8 *a = (u8*)pRec; /* Typecast byte array */ |
| 61763 | Mem *pMem = *ppVal; /* Write result into this Mem object */ |
| 61764 | |
| 61765 | assert( iCol>0 ); |
| 61766 | iHdr = getVarint32(a, nHdr); |
| 61767 | if( nHdr>nRec || iHdr>=nHdr ) return SQLITE_CORRUPT_BKPT; |
| 61768 | iField = nHdr; |
| 61769 | for(i=0; i<=iCol; i++){ |
| 61770 | iHdr += getVarint32(&a[iHdr], t); |
| 61771 | testcase( iHdr==nHdr ); |
| 61772 | testcase( iHdr==nHdr+1 ); |
| 61773 | if( iHdr>nHdr ) return SQLITE_CORRUPT_BKPT; |
| 61774 | szField = sqlite3VdbeSerialTypeLen(t); |
| 61775 | iField += szField; |
| 61776 | } |
| 61777 | testcase( iField==nRec ); |
| 61778 | testcase( iField==nRec+1 ); |
| 61779 | if( iField>nRec ) return SQLITE_CORRUPT_BKPT; |
| 61780 | if( pMem==0 ){ |
| 61781 | pMem = *ppVal = sqlite3ValueNew(db); |
| 61782 | if( pMem==0 ) return SQLITE_NOMEM; |
| 61783 | } |
| 61784 | sqlite3VdbeSerialGet(&a[iField-szField], t, pMem); |
| 61785 | pMem->enc = ENC(db); |
| 61786 | return SQLITE_OK; |
| 61787 | } |
| 61788 | |
| 61789 | /* |
| 61790 | ** Unless it is NULL, the argument must be an UnpackedRecord object returned |
| 61791 | ** by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes |
| @@ -65315,10 +65433,11 @@ | |
| 65433 | /* rc==0 here means that one or both of the keys ran out of fields and |
| 65434 | ** all the fields up to that point were equal. Return the the default_rc |
| 65435 | ** value. */ |
| 65436 | assert( CORRUPT_DB |
| 65437 | || pPKey2->default_rc==vdbeRecordCompareDebug(nKey1, pKey1, pPKey2) |
| 65438 | || pKeyInfo->db->mallocFailed |
| 65439 | ); |
| 65440 | return pPKey2->default_rc; |
| 65441 | } |
| 65442 | |
| 65443 | /* |
| @@ -65480,10 +65599,11 @@ | |
| 65599 | |
| 65600 | assert( (res==0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)==0) |
| 65601 | || (res<0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)<0) |
| 65602 | || (res>0 && vdbeRecordCompareDebug(nKey1, pKey1, pPKey2)>0) |
| 65603 | || CORRUPT_DB |
| 65604 | || pPKey2->pKeyInfo->db->mallocFailed |
| 65605 | ); |
| 65606 | return res; |
| 65607 | } |
| 65608 | |
| 65609 | /* |
| @@ -76853,11 +76973,12 @@ | |
| 76973 | }else{ |
| 76974 | /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to |
| 76975 | ** likelihood(X, 0.0625). |
| 76976 | ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for |
| 76977 | ** likelihood(X,0.0625). */ |
| 76978 | /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */ |
| 76979 | pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938; |
| 76980 | } |
| 76981 | } |
| 76982 | } |
| 76983 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 76984 | if( pDef ){ |
| @@ -77629,11 +77750,11 @@ | |
| 77750 | ** SELECT * FROM t1 WHERE (select a from t1); |
| 77751 | */ |
| 77752 | SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ |
| 77753 | int op; |
| 77754 | pExpr = sqlite3ExprSkipCollate(pExpr); |
| 77755 | if( pExpr->flags & EP_Generic ) return 0; |
| 77756 | op = pExpr->op; |
| 77757 | if( op==TK_SELECT ){ |
| 77758 | assert( pExpr->flags&EP_xIsSelect ); |
| 77759 | return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); |
| 77760 | } |
| @@ -82929,10 +83050,11 @@ | |
| 83050 | /* Open the sqlite_stat[134] tables for writing. */ |
| 83051 | for(i=0; aTable[i].zCols; i++){ |
| 83052 | assert( i<ArraySize(aTable) ); |
| 83053 | sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3); |
| 83054 | sqlite3VdbeChangeP5(v, aCreateTbl[i]); |
| 83055 | VdbeComment((v, aTable[i].zName)); |
| 83056 | } |
| 83057 | } |
| 83058 | |
| 83059 | /* |
| 83060 | ** Recommended number of samples for sqlite_stat4 |
| @@ -82964,11 +83086,12 @@ | |
| 83086 | #endif |
| 83087 | }; |
| 83088 | struct Stat4Accum { |
| 83089 | tRowcnt nRow; /* Number of rows in the entire table */ |
| 83090 | tRowcnt nPSample; /* How often to do a periodic sample */ |
| 83091 | int nCol; /* Number of columns in index + pk/rowid */ |
| 83092 | int nKeyCol; /* Number of index columns w/o the pk/rowid */ |
| 83093 | int mxSample; /* Maximum number of samples to accumulate */ |
| 83094 | Stat4Sample current; /* Current row as a Stat4Sample */ |
| 83095 | u32 iPrn; /* Pseudo-random number used for sampling */ |
| 83096 | Stat4Sample *aBest; /* Array of nCol best samples */ |
| 83097 | int iMin; /* Index in a[] of entry with minimum score */ |
| @@ -83050,13 +83173,21 @@ | |
| 83173 | #endif |
| 83174 | sqlite3DbFree(p->db, p); |
| 83175 | } |
| 83176 | |
| 83177 | /* |
| 83178 | ** Implementation of the stat_init(N,K,C) SQL function. The three parameters |
| 83179 | ** are: |
| 83180 | ** N: The number of columns in the index including the rowid/pk |
| 83181 | ** K: The number of columns in the index excluding the rowid/pk |
| 83182 | ** C: The number of rows in the index |
| 83183 | ** |
| 83184 | ** C is only used for STAT3 and STAT4. |
| 83185 | ** |
| 83186 | ** For ordinary rowid tables, N==K+1. But for WITHOUT ROWID tables, |
| 83187 | ** N=K+P where P is the number of columns in the primary key. For the |
| 83188 | ** covering index that implements the original WITHOUT ROWID table, N==K. |
| 83189 | ** |
| 83190 | ** This routine allocates the Stat4Accum object in heap memory. The return |
| 83191 | ** value is a pointer to the the Stat4Accum object encoded as a blob (i.e. |
| 83192 | ** the size of the blob is sizeof(void*) bytes). |
| 83193 | */ |
| @@ -83065,10 +83196,11 @@ | |
| 83196 | int argc, |
| 83197 | sqlite3_value **argv |
| 83198 | ){ |
| 83199 | Stat4Accum *p; |
| 83200 | int nCol; /* Number of columns in index being sampled */ |
| 83201 | int nKeyCol; /* Number of key columns */ |
| 83202 | int nColUp; /* nCol rounded up for alignment */ |
| 83203 | int n; /* Bytes of space to allocate */ |
| 83204 | sqlite3 *db; /* Database connection */ |
| 83205 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83206 | int mxSample = SQLITE_STAT4_SAMPLES; |
| @@ -83075,12 +83207,15 @@ | |
| 83207 | #endif |
| 83208 | |
| 83209 | /* Decode the three function arguments */ |
| 83210 | UNUSED_PARAMETER(argc); |
| 83211 | nCol = sqlite3_value_int(argv[0]); |
| 83212 | assert( nCol>0 ); |
| 83213 | nColUp = sizeof(tRowcnt)<8 ? (nCol+1)&~1 : nCol; |
| 83214 | nKeyCol = sqlite3_value_int(argv[1]); |
| 83215 | assert( nKeyCol<=nCol ); |
| 83216 | assert( nKeyCol>0 ); |
| 83217 | |
| 83218 | /* Allocate the space required for the Stat4Accum object */ |
| 83219 | n = sizeof(*p) |
| 83220 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ |
| 83221 | + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ |
| @@ -83098,10 +83233,11 @@ | |
| 83233 | } |
| 83234 | |
| 83235 | p->db = db; |
| 83236 | p->nRow = 0; |
| 83237 | p->nCol = nCol; |
| 83238 | p->nKeyCol = nKeyCol; |
| 83239 | p->current.anDLt = (tRowcnt*)&p[1]; |
| 83240 | p->current.anEq = &p->current.anDLt[nColUp]; |
| 83241 | |
| 83242 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83243 | { |
| @@ -83108,13 +83244,13 @@ | |
| 83244 | u8 *pSpace; /* Allocated space not yet assigned */ |
| 83245 | int i; /* Used to iterate through p->aSample[] */ |
| 83246 | |
| 83247 | p->iGet = -1; |
| 83248 | p->mxSample = mxSample; |
| 83249 | p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); |
| 83250 | p->current.anLt = &p->current.anEq[nColUp]; |
| 83251 | p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565; |
| 83252 | |
| 83253 | /* Set up the Stat4Accum.a[] and aBest[] arrays */ |
| 83254 | p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; |
| 83255 | p->aBest = &p->a[mxSample]; |
| 83256 | pSpace = (u8*)(&p->a[mxSample+nCol]); |
| @@ -83133,11 +83269,11 @@ | |
| 83269 | |
| 83270 | /* Return a pointer to the allocated object to the caller */ |
| 83271 | sqlite3_result_blob(context, p, sizeof(p), stat4Destructor); |
| 83272 | } |
| 83273 | static const FuncDef statInitFuncdef = { |
| 83274 | 2+IsStat34, /* nArg */ |
| 83275 | SQLITE_UTF8, /* funcFlags */ |
| 83276 | 0, /* pUserData */ |
| 83277 | 0, /* pNext */ |
| 83278 | statInit, /* xFunc */ |
| 83279 | 0, /* xStep */ |
| @@ -83374,11 +83510,11 @@ | |
| 83510 | Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]); |
| 83511 | int iChng = sqlite3_value_int(argv[1]); |
| 83512 | |
| 83513 | UNUSED_PARAMETER( argc ); |
| 83514 | UNUSED_PARAMETER( context ); |
| 83515 | assert( p->nCol>0 ); |
| 83516 | assert( iChng<p->nCol ); |
| 83517 | |
| 83518 | if( p->nRow==0 ){ |
| 83519 | /* This is the first call to this function. Do initialization. */ |
| 83520 | for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1; |
| @@ -83502,19 +83638,19 @@ | |
| 83638 | ** I = (K+D-1)/D |
| 83639 | */ |
| 83640 | char *z; |
| 83641 | int i; |
| 83642 | |
| 83643 | char *zRet = sqlite3MallocZero( (p->nKeyCol+1)*25 ); |
| 83644 | if( zRet==0 ){ |
| 83645 | sqlite3_result_error_nomem(context); |
| 83646 | return; |
| 83647 | } |
| 83648 | |
| 83649 | sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow); |
| 83650 | z = zRet + sqlite3Strlen30(zRet); |
| 83651 | for(i=0; i<p->nKeyCol; i++){ |
| 83652 | u64 nDistinct = p->current.anDLt[i] + 1; |
| 83653 | u64 iVal = (p->nRow + nDistinct - 1) / nDistinct; |
| 83654 | sqlite3_snprintf(24, z, " %llu", iVal); |
| 83655 | z += sqlite3Strlen30(z); |
| 83656 | assert( p->current.anEq[i] ); |
| @@ -83679,22 +83815,23 @@ | |
| 83815 | int addrNextRow; /* Address of "next_row:" */ |
| 83816 | const char *zIdxName; /* Name of the index */ |
| 83817 | |
| 83818 | if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
| 83819 | if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0; |
| 83820 | if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ |
| 83821 | nCol = pIdx->nKeyCol; |
| 83822 | zIdxName = pTab->zName; |
| 83823 | }else{ |
| 83824 | nCol = pIdx->nColumn; |
| 83825 | zIdxName = pIdx->zName; |
| 83826 | } |
| 83827 | aGotoChng = sqlite3DbMallocRaw(db, sizeof(int)*(nCol+1)); |
| 83828 | if( aGotoChng==0 ) continue; |
| 83829 | |
| 83830 | /* Populate the register containing the index name. */ |
| 83831 | sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, zIdxName, 0); |
| 83832 | VdbeComment((v, "Analysis for %s.%s", pTab->zName, zIdxName)); |
| 83833 | |
| 83834 | /* |
| 83835 | ** Pseudo-code for loop that calls stat_push(): |
| 83836 | ** |
| 83837 | ** Rewind csr |
| @@ -83744,16 +83881,17 @@ | |
| 83881 | ** (2) the number of rows in the index, |
| 83882 | ** |
| 83883 | ** The second argument is only used for STAT3 and STAT4 |
| 83884 | */ |
| 83885 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 83886 | sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3); |
| 83887 | #endif |
| 83888 | sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1); |
| 83889 | sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2); |
| 83890 | sqlite3VdbeAddOp3(v, OP_Function, 0, regStat4+1, regStat4); |
| 83891 | sqlite3VdbeChangeP4(v, -1, (char*)&statInitFuncdef, P4_FUNCDEF); |
| 83892 | sqlite3VdbeChangeP5(v, 2+IsStat34); |
| 83893 | |
| 83894 | /* Implementation of the following: |
| 83895 | ** |
| 83896 | ** Rewind csr |
| 83897 | ** if eof(csr) goto end_of_scan; |
| @@ -83851,11 +83989,11 @@ | |
| 83989 | int regSampleRowid = regCol + nCol; |
| 83990 | int addrNext; |
| 83991 | int addrIsNull; |
| 83992 | u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound; |
| 83993 | |
| 83994 | pParse->nMem = MAX(pParse->nMem, regCol+nCol); |
| 83995 | |
| 83996 | addrNext = sqlite3VdbeCurrentAddr(v); |
| 83997 | callStatGet(v, regStat4, STAT_GET_ROWID, regSampleRowid); |
| 83998 | addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid); |
| 83999 | VdbeCoverage(v); |
| @@ -83873,11 +84011,11 @@ | |
| 84011 | #else |
| 84012 | for(i=0; i<nCol; i++){ |
| 84013 | i16 iCol = pIdx->aiColumn[i]; |
| 84014 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i); |
| 84015 | } |
| 84016 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol, regSample); |
| 84017 | #endif |
| 84018 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp); |
| 84019 | sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid); |
| 84020 | sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid); |
| 84021 | sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */ |
| @@ -84185,11 +84323,20 @@ | |
| 84323 | static void initAvgEq(Index *pIdx){ |
| 84324 | if( pIdx ){ |
| 84325 | IndexSample *aSample = pIdx->aSample; |
| 84326 | IndexSample *pFinal = &aSample[pIdx->nSample-1]; |
| 84327 | int iCol; |
| 84328 | int nCol = 1; |
| 84329 | if( pIdx->nSampleCol>1 ){ |
| 84330 | /* If this is stat4 data, then calculate aAvgEq[] values for all |
| 84331 | ** sample columns except the last. The last is always set to 1, as |
| 84332 | ** once the trailing PK fields are considered all index keys are |
| 84333 | ** unique. */ |
| 84334 | nCol = pIdx->nSampleCol-1; |
| 84335 | pIdx->aAvgEq[nCol] = 1; |
| 84336 | } |
| 84337 | for(iCol=0; iCol<nCol; iCol++){ |
| 84338 | int i; /* Used to iterate through samples */ |
| 84339 | tRowcnt sumEq = 0; /* Sum of the nEq values */ |
| 84340 | tRowcnt nSum = 0; /* Number of terms contributing to sumEq */ |
| 84341 | tRowcnt avgEq = 0; |
| 84342 | tRowcnt nDLt = pFinal->anDLt[iCol]; |
| @@ -84208,11 +84355,10 @@ | |
| 84355 | if( nDLt>nSum ){ |
| 84356 | avgEq = (pFinal->anLt[iCol] - sumEq)/(nDLt - nSum); |
| 84357 | } |
| 84358 | if( avgEq==0 ) avgEq = 1; |
| 84359 | pIdx->aAvgEq[iCol] = avgEq; |
| 84360 | } |
| 84361 | } |
| 84362 | } |
| 84363 | |
| 84364 | /* |
| @@ -84267,11 +84413,10 @@ | |
| 84413 | sqlite3DbFree(db, zSql); |
| 84414 | if( rc ) return rc; |
| 84415 | |
| 84416 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 84417 | int nIdxCol = 1; /* Number of columns in stat4 records */ |
| 84418 | |
| 84419 | char *zIndex; /* Index name */ |
| 84420 | Index *pIdx; /* Pointer to the index object */ |
| 84421 | int nSample; /* Number of samples */ |
| 84422 | int nByte; /* Bytes of space required */ |
| @@ -84285,25 +84430,29 @@ | |
| 84430 | assert( pIdx==0 || bStat3 || pIdx->nSample==0 ); |
| 84431 | /* Index.nSample is non-zero at this point if data has already been |
| 84432 | ** loaded from the stat4 table. In this case ignore stat3 data. */ |
| 84433 | if( pIdx==0 || pIdx->nSample ) continue; |
| 84434 | if( bStat3==0 ){ |
| 84435 | assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 ); |
| 84436 | if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){ |
| 84437 | nIdxCol = pIdx->nKeyCol; |
| 84438 | }else{ |
| 84439 | nIdxCol = pIdx->nColumn; |
| 84440 | } |
| 84441 | } |
| 84442 | pIdx->nSampleCol = nIdxCol; |
| 84443 | nByte = sizeof(IndexSample) * nSample; |
| 84444 | nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample; |
| 84445 | nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */ |
| 84446 | |
| 84447 | pIdx->aSample = sqlite3DbMallocZero(db, nByte); |
| 84448 | if( pIdx->aSample==0 ){ |
| 84449 | sqlite3_finalize(pStmt); |
| 84450 | return SQLITE_NOMEM; |
| 84451 | } |
| 84452 | pSpace = (tRowcnt*)&pIdx->aSample[nSample]; |
| 84453 | pIdx->aAvgEq = pSpace; pSpace += nIdxCol; |
| 84454 | for(i=0; i<nSample; i++){ |
| 84455 | pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol; |
| 84456 | pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol; |
| 84457 | pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol; |
| 84458 | } |
| @@ -92553,10 +92702,11 @@ | |
| 92702 | FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92703 | FUNCTION(hex, 1, 0, 0, hexFunc ), |
| 92704 | FUNCTION2(ifnull, 2, 0, 0, noopFunc, SQLITE_FUNC_COALESCE), |
| 92705 | FUNCTION2(unlikely, 1, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92706 | FUNCTION2(likelihood, 2, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92707 | FUNCTION2(likely, 1, 0, 0, noopFunc, SQLITE_FUNC_UNLIKELY), |
| 92708 | VFUNCTION(random, 0, 0, 0, randomFunc ), |
| 92709 | VFUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 92710 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 92711 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 92712 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| @@ -110581,11 +110731,11 @@ | |
| 110731 | pScan->pOrigWC = pWC; |
| 110732 | pScan->pWC = pWC; |
| 110733 | if( pIdx && iColumn>=0 ){ |
| 110734 | pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity; |
| 110735 | for(j=0; pIdx->aiColumn[j]!=iColumn; j++){ |
| 110736 | if( NEVER(j>pIdx->nColumn) ) return 0; |
| 110737 | } |
| 110738 | pScan->zCollName = pIdx->azColl[j]; |
| 110739 | }else{ |
| 110740 | pScan->idxaff = 0; |
| 110741 | pScan->zCollName = 0; |
| @@ -111531,12 +111681,11 @@ | |
| 111681 | |
| 111682 | /* |
| 111683 | ** Estimate the logarithm of the input value to base 2. |
| 111684 | */ |
| 111685 | static LogEst estLog(LogEst N){ |
| 111686 | return N<=10 ? 0 : sqlite3LogEst(N) - 33; |
| 111687 | } |
| 111688 | |
| 111689 | /* |
| 111690 | ** Two routines for printing the content of an sqlite3_index_info |
| 111691 | ** structure. Used for testing and debugging only. If neither |
| @@ -111997,11 +112146,11 @@ | |
| 112146 | }else{ |
| 112147 | i64 nRow0 = sqlite3LogEstToInt(pIdx->aiRowLogEst[0]); |
| 112148 | iUpper = i>=pIdx->nSample ? nRow0 : aSample[i].anLt[iCol]; |
| 112149 | iLower = aSample[i-1].anEq[iCol] + aSample[i-1].anLt[iCol]; |
| 112150 | } |
| 112151 | aStat[1] = pIdx->aAvgEq[iCol]; |
| 112152 | if( iLower>=iUpper ){ |
| 112153 | iGap = 0; |
| 112154 | }else{ |
| 112155 | iGap = iUpper - iLower; |
| 112156 | } |
| @@ -112036,10 +112185,118 @@ | |
| 112185 | } |
| 112186 | } |
| 112187 | return nRet; |
| 112188 | } |
| 112189 | |
| 112190 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 112191 | /* |
| 112192 | ** This function is called to estimate the number of rows visited by a |
| 112193 | ** range-scan on a skip-scan index. For example: |
| 112194 | ** |
| 112195 | ** CREATE INDEX i1 ON t1(a, b, c); |
| 112196 | ** SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?; |
| 112197 | ** |
| 112198 | ** Value pLoop->nOut is currently set to the estimated number of rows |
| 112199 | ** visited for scanning (a=? AND b=?). This function reduces that estimate |
| 112200 | ** by some factor to account for the (c BETWEEN ? AND ?) expression based |
| 112201 | ** on the stat4 data for the index. this scan will be peformed multiple |
| 112202 | ** times (once for each (a,b) combination that matches a=?) is dealt with |
| 112203 | ** by the caller. |
| 112204 | ** |
| 112205 | ** It does this by scanning through all stat4 samples, comparing values |
| 112206 | ** extracted from pLower and pUpper with the corresponding column in each |
| 112207 | ** sample. If L and U are the number of samples found to be less than or |
| 112208 | ** equal to the values extracted from pLower and pUpper respectively, and |
| 112209 | ** N is the total number of samples, the pLoop->nOut value is adjusted |
| 112210 | ** as follows: |
| 112211 | ** |
| 112212 | ** nOut = nOut * ( min(U - L, 1) / N ) |
| 112213 | ** |
| 112214 | ** If pLower is NULL, or a value cannot be extracted from the term, L is |
| 112215 | ** set to zero. If pUpper is NULL, or a value cannot be extracted from it, |
| 112216 | ** U is set to N. |
| 112217 | ** |
| 112218 | ** Normally, this function sets *pbDone to 1 before returning. However, |
| 112219 | ** if no value can be extracted from either pLower or pUpper (and so the |
| 112220 | ** estimate of the number of rows delivered remains unchanged), *pbDone |
| 112221 | ** is left as is. |
| 112222 | ** |
| 112223 | ** If an error occurs, an SQLite error code is returned. Otherwise, |
| 112224 | ** SQLITE_OK. |
| 112225 | */ |
| 112226 | static int whereRangeSkipScanEst( |
| 112227 | Parse *pParse, /* Parsing & code generating context */ |
| 112228 | WhereTerm *pLower, /* Lower bound on the range. ex: "x>123" Might be NULL */ |
| 112229 | WhereTerm *pUpper, /* Upper bound on the range. ex: "x<455" Might be NULL */ |
| 112230 | WhereLoop *pLoop, /* Update the .nOut value of this loop */ |
| 112231 | int *pbDone /* Set to true if at least one expr. value extracted */ |
| 112232 | ){ |
| 112233 | Index *p = pLoop->u.btree.pIndex; |
| 112234 | int nEq = pLoop->u.btree.nEq; |
| 112235 | sqlite3 *db = pParse->db; |
| 112236 | int nLower = -1; |
| 112237 | int nUpper = p->nSample+1; |
| 112238 | int rc = SQLITE_OK; |
| 112239 | u8 aff = p->pTable->aCol[ p->aiColumn[nEq] ].affinity; |
| 112240 | CollSeq *pColl; |
| 112241 | |
| 112242 | sqlite3_value *p1 = 0; /* Value extracted from pLower */ |
| 112243 | sqlite3_value *p2 = 0; /* Value extracted from pUpper */ |
| 112244 | sqlite3_value *pVal = 0; /* Value extracted from record */ |
| 112245 | |
| 112246 | pColl = sqlite3LocateCollSeq(pParse, p->azColl[nEq]); |
| 112247 | if( pLower ){ |
| 112248 | rc = sqlite3Stat4ValueFromExpr(pParse, pLower->pExpr->pRight, aff, &p1); |
| 112249 | nLower = 0; |
| 112250 | } |
| 112251 | if( pUpper && rc==SQLITE_OK ){ |
| 112252 | rc = sqlite3Stat4ValueFromExpr(pParse, pUpper->pExpr->pRight, aff, &p2); |
| 112253 | nUpper = p2 ? 0 : p->nSample; |
| 112254 | } |
| 112255 | |
| 112256 | if( p1 || p2 ){ |
| 112257 | int i; |
| 112258 | int nDiff; |
| 112259 | for(i=0; rc==SQLITE_OK && i<p->nSample; i++){ |
| 112260 | rc = sqlite3Stat4Column(db, p->aSample[i].p, p->aSample[i].n, nEq, &pVal); |
| 112261 | if( rc==SQLITE_OK && p1 ){ |
| 112262 | int res = sqlite3MemCompare(p1, pVal, pColl); |
| 112263 | if( res>=0 ) nLower++; |
| 112264 | } |
| 112265 | if( rc==SQLITE_OK && p2 ){ |
| 112266 | int res = sqlite3MemCompare(p2, pVal, pColl); |
| 112267 | if( res>=0 ) nUpper++; |
| 112268 | } |
| 112269 | } |
| 112270 | nDiff = (nUpper - nLower); |
| 112271 | if( nDiff<=0 ) nDiff = 1; |
| 112272 | |
| 112273 | /* If there is both an upper and lower bound specified, and the |
| 112274 | ** comparisons indicate that they are close together, use the fallback |
| 112275 | ** method (assume that the scan visits 1/64 of the rows) for estimating |
| 112276 | ** the number of rows visited. Otherwise, estimate the number of rows |
| 112277 | ** using the method described in the header comment for this function. */ |
| 112278 | if( nDiff!=1 || pUpper==0 || pLower==0 ){ |
| 112279 | int nAdjust = (sqlite3LogEst(p->nSample) - sqlite3LogEst(nDiff)); |
| 112280 | pLoop->nOut -= nAdjust; |
| 112281 | *pbDone = 1; |
| 112282 | WHERETRACE(0x10, ("range skip-scan regions: %u..%u adjust=%d est=%d\n", |
| 112283 | nLower, nUpper, nAdjust*-1, pLoop->nOut)); |
| 112284 | } |
| 112285 | |
| 112286 | }else{ |
| 112287 | assert( *pbDone==0 ); |
| 112288 | } |
| 112289 | |
| 112290 | sqlite3ValueFree(p1); |
| 112291 | sqlite3ValueFree(p2); |
| 112292 | sqlite3ValueFree(pVal); |
| 112293 | |
| 112294 | return rc; |
| 112295 | } |
| 112296 | #endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */ |
| 112297 | |
| 112298 | /* |
| 112299 | ** This function is used to estimate the number of rows that will be visited |
| 112300 | ** by scanning an index for a range of values. The range may have an upper |
| 112301 | ** bound, a lower bound, or both. The WHERE clause terms that set the upper |
| 112302 | ** and lower bounds are represented by pLower and pUpper respectively. For |
| @@ -112072,13 +112329,13 @@ | |
| 112329 | ** considering the range constraints. If nEq is 0, this is the number of |
| 112330 | ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) |
| 112331 | ** to account for the range contraints pLower and pUpper. |
| 112332 | ** |
| 112333 | ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be |
| 112334 | ** used, a single range inequality reduces the search space by a factor of 4. |
| 112335 | ** and a pair of constraints (x>? AND x<?) reduces the expected number of |
| 112336 | ** rows visited by a factor of 64. |
| 112337 | */ |
| 112338 | static int whereRangeScanEst( |
| 112339 | Parse *pParse, /* Parsing & code generating context */ |
| 112340 | WhereLoopBuilder *pBuilder, |
| 112341 | WhereTerm *pLower, /* Lower bound on the range. ex: "x>123" Might be NULL */ |
| @@ -112092,99 +112349,104 @@ | |
| 112349 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| 112350 | Index *p = pLoop->u.btree.pIndex; |
| 112351 | int nEq = pLoop->u.btree.nEq; |
| 112352 | |
| 112353 | if( p->nSample>0 |
| 112354 | && nEq<p->nSampleCol |
| 112355 | && OptimizationEnabled(pParse->db, SQLITE_Stat3) |
| 112356 | ){ |
| 112357 | if( nEq==pBuilder->nRecValid ){ |
| 112358 | UnpackedRecord *pRec = pBuilder->pRec; |
| 112359 | tRowcnt a[2]; |
| 112360 | u8 aff; |
| 112361 | |
| 112362 | /* Variable iLower will be set to the estimate of the number of rows in |
| 112363 | ** the index that are less than the lower bound of the range query. The |
| 112364 | ** lower bound being the concatenation of $P and $L, where $P is the |
| 112365 | ** key-prefix formed by the nEq values matched against the nEq left-most |
| 112366 | ** columns of the index, and $L is the value in pLower. |
| 112367 | ** |
| 112368 | ** Or, if pLower is NULL or $L cannot be extracted from it (because it |
| 112369 | ** is not a simple variable or literal value), the lower bound of the |
| 112370 | ** range is $P. Due to a quirk in the way whereKeyStats() works, even |
| 112371 | ** if $L is available, whereKeyStats() is called for both ($P) and |
| 112372 | ** ($P:$L) and the larger of the two returned values used. |
| 112373 | ** |
| 112374 | ** Similarly, iUpper is to be set to the estimate of the number of rows |
| 112375 | ** less than the upper bound of the range query. Where the upper bound |
| 112376 | ** is either ($P) or ($P:$U). Again, even if $U is available, both values |
| 112377 | ** of iUpper are requested of whereKeyStats() and the smaller used. |
| 112378 | */ |
| 112379 | tRowcnt iLower; |
| 112380 | tRowcnt iUpper; |
| 112381 | |
| 112382 | if( nEq==p->nKeyCol ){ |
| 112383 | aff = SQLITE_AFF_INTEGER; |
| 112384 | }else{ |
| 112385 | aff = p->pTable->aCol[p->aiColumn[nEq]].affinity; |
| 112386 | } |
| 112387 | /* Determine iLower and iUpper using ($P) only. */ |
| 112388 | if( nEq==0 ){ |
| 112389 | iLower = 0; |
| 112390 | iUpper = sqlite3LogEstToInt(p->aiRowLogEst[0]); |
| 112391 | }else{ |
| 112392 | /* Note: this call could be optimized away - since the same values must |
| 112393 | ** have been requested when testing key $P in whereEqualScanEst(). */ |
| 112394 | whereKeyStats(pParse, p, pRec, 0, a); |
| 112395 | iLower = a[0]; |
| 112396 | iUpper = a[0] + a[1]; |
| 112397 | } |
| 112398 | |
| 112399 | /* If possible, improve on the iLower estimate using ($P:$L). */ |
| 112400 | if( pLower ){ |
| 112401 | int bOk; /* True if value is extracted from pExpr */ |
| 112402 | Expr *pExpr = pLower->pExpr->pRight; |
| 112403 | assert( (pLower->eOperator & (WO_GT|WO_GE))!=0 ); |
| 112404 | rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); |
| 112405 | if( rc==SQLITE_OK && bOk ){ |
| 112406 | tRowcnt iNew; |
| 112407 | whereKeyStats(pParse, p, pRec, 0, a); |
| 112408 | iNew = a[0] + ((pLower->eOperator & WO_GT) ? a[1] : 0); |
| 112409 | if( iNew>iLower ) iLower = iNew; |
| 112410 | nOut--; |
| 112411 | } |
| 112412 | } |
| 112413 | |
| 112414 | /* If possible, improve on the iUpper estimate using ($P:$U). */ |
| 112415 | if( pUpper ){ |
| 112416 | int bOk; /* True if value is extracted from pExpr */ |
| 112417 | Expr *pExpr = pUpper->pExpr->pRight; |
| 112418 | assert( (pUpper->eOperator & (WO_LT|WO_LE))!=0 ); |
| 112419 | rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk); |
| 112420 | if( rc==SQLITE_OK && bOk ){ |
| 112421 | tRowcnt iNew; |
| 112422 | whereKeyStats(pParse, p, pRec, 1, a); |
| 112423 | iNew = a[0] + ((pUpper->eOperator & WO_LE) ? a[1] : 0); |
| 112424 | if( iNew<iUpper ) iUpper = iNew; |
| 112425 | nOut--; |
| 112426 | } |
| 112427 | } |
| 112428 | |
| 112429 | pBuilder->pRec = pRec; |
| 112430 | if( rc==SQLITE_OK ){ |
| 112431 | if( iUpper>iLower ){ |
| 112432 | nNew = sqlite3LogEst(iUpper - iLower); |
| 112433 | }else{ |
| 112434 | nNew = 10; assert( 10==sqlite3LogEst(2) ); |
| 112435 | } |
| 112436 | if( nNew<nOut ){ |
| 112437 | nOut = nNew; |
| 112438 | } |
| 112439 | pLoop->nOut = (LogEst)nOut; |
| 112440 | WHERETRACE(0x10, ("range scan regions: %u..%u est=%d\n", |
| 112441 | (u32)iLower, (u32)iUpper, nOut)); |
| 112442 | return SQLITE_OK; |
| 112443 | } |
| 112444 | }else{ |
| 112445 | int bDone = 0; |
| 112446 | rc = whereRangeSkipScanEst(pParse, pLower, pUpper, pLoop, &bDone); |
| 112447 | if( bDone ) return rc; |
| 112448 | } |
| 112449 | } |
| 112450 | #else |
| 112451 | UNUSED_PARAMETER(pParse); |
| 112452 | UNUSED_PARAMETER(pBuilder); |
| @@ -112239,11 +112501,11 @@ | |
| 112501 | int rc; /* Subfunction return code */ |
| 112502 | tRowcnt a[2]; /* Statistics */ |
| 112503 | int bOk; |
| 112504 | |
| 112505 | assert( nEq>=1 ); |
| 112506 | assert( nEq<=p->nColumn ); |
| 112507 | assert( p->aSample!=0 ); |
| 112508 | assert( p->nSample>0 ); |
| 112509 | assert( pBuilder->nRecValid<nEq ); |
| 112510 | |
| 112511 | /* If values are not available for all fields of the index to the left |
| @@ -112252,11 +112514,11 @@ | |
| 112514 | return SQLITE_NOTFOUND; |
| 112515 | } |
| 112516 | |
| 112517 | /* This is an optimization only. The call to sqlite3Stat4ProbeSetValue() |
| 112518 | ** below would return the same value. */ |
| 112519 | if( nEq>=p->nColumn ){ |
| 112520 | *pnRow = 1; |
| 112521 | return SQLITE_OK; |
| 112522 | } |
| 112523 | |
| 112524 | aff = p->pTable->aCol[p->aiColumn[nEq-1]].affinity; |
| @@ -112683,11 +112945,11 @@ | |
| 112945 | } |
| 112946 | sqlite3StrAccumInit(&txt, 0, 0, SQLITE_MAX_LENGTH); |
| 112947 | txt.db = db; |
| 112948 | sqlite3StrAccumAppend(&txt, " (", 2); |
| 112949 | for(i=0; i<nEq; i++){ |
| 112950 | char *z = aiColumn[i] < 0 ? "rowid" : aCol[aiColumn[i]].zName; |
| 112951 | if( i>=nSkip ){ |
| 112952 | explainAppendTerm(&txt, i, z, "="); |
| 112953 | }else{ |
| 112954 | if( i ) sqlite3StrAccumAppend(&txt, " AND ", 5); |
| 112955 | sqlite3StrAccumAppend(&txt, "ANY(", 4); |
| @@ -112696,15 +112958,15 @@ | |
| 112958 | } |
| 112959 | } |
| 112960 | |
| 112961 | j = i; |
| 112962 | if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ |
| 112963 | char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; |
| 112964 | explainAppendTerm(&txt, i++, z, ">"); |
| 112965 | } |
| 112966 | if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ |
| 112967 | char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; |
| 112968 | explainAppendTerm(&txt, i, z, "<"); |
| 112969 | } |
| 112970 | sqlite3StrAccumAppend(&txt, ")", 1); |
| 112971 | return sqlite3StrAccumFinish(&txt); |
| 112972 | } |
| @@ -113724,11 +113986,11 @@ | |
| 113986 | z = sqlite3_mprintf("(%d,%x)", p->u.vtab.idxNum, p->u.vtab.omitMask); |
| 113987 | } |
| 113988 | sqlite3DebugPrintf(" %-19s", z); |
| 113989 | sqlite3_free(z); |
| 113990 | } |
| 113991 | sqlite3DebugPrintf(" f %05x N %d", p->wsFlags, p->nLTerm); |
| 113992 | sqlite3DebugPrintf(" cost %d,%d,%d\n", p->rSetup, p->rRun, p->nOut); |
| 113993 | #ifdef SQLITE_ENABLE_TREE_EXPLAIN |
| 113994 | /* If the 0x100 bit of wheretracing is set, then show all of the constraint |
| 113995 | ** expressions in the WhereLoop.aLTerm[] array. |
| 113996 | */ |
| @@ -113960,10 +114222,21 @@ | |
| 114222 | |
| 114223 | /* whereLoopAddBtree() always generates and inserts the automatic index |
| 114224 | ** case first. Hence compatible candidate WhereLoops never have a larger |
| 114225 | ** rSetup. Call this SETUP-INVARIANT */ |
| 114226 | assert( p->rSetup>=pTemplate->rSetup ); |
| 114227 | |
| 114228 | /* Any loop using an appliation-defined index (or PRIMARY KEY or |
| 114229 | ** UNIQUE constraint) with one or more == constraints is better |
| 114230 | ** than an automatic index. */ |
| 114231 | if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 |
| 114232 | && (pTemplate->wsFlags & WHERE_INDEXED)!=0 |
| 114233 | && (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0 |
| 114234 | && (p->prereq & pTemplate->prereq)==pTemplate->prereq |
| 114235 | ){ |
| 114236 | break; |
| 114237 | } |
| 114238 | |
| 114239 | /* If existing WhereLoop p is better than pTemplate, pTemplate can be |
| 114240 | ** discarded. WhereLoop p is better if: |
| 114241 | ** (1) p has no more dependencies than pTemplate, and |
| 114242 | ** (2) p has an equal or lower cost than pTemplate |
| @@ -114085,17 +114358,17 @@ | |
| 114358 | ** p[] that are also supplated by pTemplate */ |
| 114359 | WhereLoop **ppTail = &p->pNextLoop; |
| 114360 | WhereLoop *pToDel; |
| 114361 | while( *ppTail ){ |
| 114362 | ppTail = whereLoopFindLesser(ppTail, pTemplate); |
| 114363 | if( ppTail==0 ) break; |
| 114364 | pToDel = *ppTail; |
| 114365 | if( pToDel==0 ) break; |
| 114366 | *ppTail = pToDel->pNextLoop; |
| 114367 | #if WHERETRACE_ENABLED /* 0x8 */ |
| 114368 | if( sqlite3WhereTrace & 0x8 ){ |
| 114369 | sqlite3DebugPrintf("ins-del: "); |
| 114370 | whereLoopPrint(pToDel, pBuilder->pWC); |
| 114371 | } |
| 114372 | #endif |
| 114373 | whereLoopDelete(db, pToDel); |
| 114374 | } |
| @@ -114191,16 +114464,13 @@ | |
| 114464 | }else{ |
| 114465 | opMask = WO_EQ|WO_IN|WO_ISNULL|WO_GT|WO_GE|WO_LT|WO_LE; |
| 114466 | } |
| 114467 | if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); |
| 114468 | |
| 114469 | assert( pNew->u.btree.nEq<pProbe->nColumn ); |
| 114470 | iCol = pProbe->aiColumn[pNew->u.btree.nEq]; |
| 114471 | |
| 114472 | pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, iCol, |
| 114473 | opMask, pProbe); |
| 114474 | saved_nEq = pNew->u.btree.nEq; |
| 114475 | saved_nSkip = pNew->u.btree.nSkip; |
| 114476 | saved_nLTerm = pNew->nLTerm; |
| @@ -114386,11 +114656,11 @@ | |
| 114656 | }else{ |
| 114657 | pNew->nOut = nOutUnadjusted; |
| 114658 | } |
| 114659 | |
| 114660 | if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 |
| 114661 | && pNew->u.btree.nEq<pProbe->nColumn |
| 114662 | ){ |
| 114663 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn); |
| 114664 | } |
| 114665 | pNew->nOut = saved_nOut; |
| 114666 | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 |
| @@ -114533,10 +114803,11 @@ | |
| 114803 | ** fake index the first in a chain of Index objects with all of the real |
| 114804 | ** indices to follow */ |
| 114805 | Index *pFirst; /* First of real indices on the table */ |
| 114806 | memset(&sPk, 0, sizeof(Index)); |
| 114807 | sPk.nKeyCol = 1; |
| 114808 | sPk.nColumn = 1; |
| 114809 | sPk.aiColumn = &aiColumnPk; |
| 114810 | sPk.aiRowLogEst = aiRowEstPk; |
| 114811 | sPk.onError = OE_Replace; |
| 114812 | sPk.pTable = pTab; |
| 114813 | sPk.szIdxRow = pTab->szTabRow; |
| @@ -115316,11 +115587,10 @@ | |
| 115587 | int mxI = 0; /* Index of next entry to replace */ |
| 115588 | int nOrderBy; /* Number of ORDER BY clause terms */ |
| 115589 | LogEst rCost; /* Cost of a path */ |
| 115590 | LogEst nOut; /* Number of outputs */ |
| 115591 | LogEst mxCost = 0; /* Maximum cost of a set of paths */ |
| 115592 | int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */ |
| 115593 | WherePath *aFrom; /* All nFrom paths at the previous level */ |
| 115594 | WherePath *aTo; /* The nTo best paths at the current level */ |
| 115595 | WherePath *pFrom; /* An element of aFrom[] that we are working on */ |
| 115596 | WherePath *pTo; /* An element of aTo[] that we are working on */ |
| @@ -115426,12 +115696,10 @@ | |
| 115696 | } |
| 115697 | /* Check to see if pWLoop should be added to the mxChoice best so far */ |
| 115698 | for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){ |
| 115699 | if( pTo->maskLoop==maskNew |
| 115700 | && ((pTo->isOrdered^isOrdered)&80)==0 |
| 115701 | ){ |
| 115702 | testcase( jj==nTo-1 ); |
| 115703 | break; |
| 115704 | } |
| 115705 | } |
| @@ -115461,11 +115729,11 @@ | |
| 115729 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| 115730 | isOrdered>=0 ? isOrdered+'0' : '?'); |
| 115731 | } |
| 115732 | #endif |
| 115733 | }else{ |
| 115734 | if( pTo->rCost<=rCost ){ |
| 115735 | #ifdef WHERETRACE_ENABLED /* 0x4 */ |
| 115736 | if( sqlite3WhereTrace&0x4 ){ |
| 115737 | sqlite3DebugPrintf( |
| 115738 | "Skip %s cost=%-3d,%3d order=%c", |
| 115739 | wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, |
| @@ -115501,15 +115769,13 @@ | |
| 115769 | memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop); |
| 115770 | pTo->aLoop[iLoop] = pWLoop; |
| 115771 | if( nTo>=mxChoice ){ |
| 115772 | mxI = 0; |
| 115773 | mxCost = aTo[0].rCost; |
| 115774 | for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){ |
| 115775 | if( pTo->rCost>mxCost ){ |
| 115776 | mxCost = pTo->rCost; |
| 115777 | mxI = jj; |
| 115778 | } |
| 115779 | } |
| 115780 | } |
| 115781 | } |
| @@ -124205,14 +124471,14 @@ | |
| 124471 | ** sqlite3_test_control(). |
| 124472 | */ |
| 124473 | case SQLITE_TESTCTRL_FAULT_INSTALL: { |
| 124474 | /* MSVC is picky about pulling func ptrs from va lists. |
| 124475 | ** http://support.microsoft.com/kb/47961 |
| 124476 | ** sqlite3GlobalConfig.xTestCallback = va_arg(ap, int(*)(int)); |
| 124477 | */ |
| 124478 | typedef int(*TESTCALLBACKFUNC_t)(int); |
| 124479 | sqlite3GlobalConfig.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t); |
| 124480 | rc = sqlite3FaultSim(0); |
| 124481 | break; |
| 124482 | } |
| 124483 | |
| 124484 | /* |
| @@ -140777,38 +141043,40 @@ | |
| 141043 | i64 iDocid = sqlite3_column_int64(pStmt, 0); |
| 141044 | int iLang = langidFromSelect(p, pStmt); |
| 141045 | int iCol; |
| 141046 | |
| 141047 | for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){ |
| 141048 | if( p->abNotindexed[iCol]==0 ){ |
| 141049 | const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); |
| 141050 | int nText = sqlite3_column_bytes(pStmt, iCol+1); |
| 141051 | sqlite3_tokenizer_cursor *pT = 0; |
| 141052 | |
| 141053 | rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText,&pT); |
| 141054 | while( rc==SQLITE_OK ){ |
| 141055 | char const *zToken; /* Buffer containing token */ |
| 141056 | int nToken = 0; /* Number of bytes in token */ |
| 141057 | int iDum1 = 0, iDum2 = 0; /* Dummy variables */ |
| 141058 | int iPos = 0; /* Position of token in zText */ |
| 141059 | |
| 141060 | rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); |
| 141061 | if( rc==SQLITE_OK ){ |
| 141062 | int i; |
| 141063 | cksum2 = cksum2 ^ fts3ChecksumEntry( |
| 141064 | zToken, nToken, iLang, 0, iDocid, iCol, iPos |
| 141065 | ); |
| 141066 | for(i=1; i<p->nIndex; i++){ |
| 141067 | if( p->aIndex[i].nPrefix<=nToken ){ |
| 141068 | cksum2 = cksum2 ^ fts3ChecksumEntry( |
| 141069 | zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos |
| 141070 | ); |
| 141071 | } |
| 141072 | } |
| 141073 | } |
| 141074 | } |
| 141075 | if( pT ) pModule->xClose(pT); |
| 141076 | if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
| 141077 | } |
| 141078 | } |
| 141079 | } |
| 141080 | |
| 141081 | sqlite3_finalize(pStmt); |
| 141082 | } |
| 141083 |
+3
-3
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -105,13 +105,13 @@ | ||
| 105 | 105 | ** |
| 106 | 106 | ** See also: [sqlite3_libversion()], |
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | -#define SQLITE_VERSION "3.8.5" | |
| 111 | -#define SQLITE_VERSION_NUMBER 3008005 | |
| 112 | -#define SQLITE_SOURCE_ID "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212" | |
| 110 | +#define SQLITE_VERSION "3.8.6" | |
| 111 | +#define SQLITE_VERSION_NUMBER 3008006 | |
| 112 | +#define SQLITE_SOURCE_ID "2014-07-01 11:54:02 21981e35062cc6b30e9576786cbf55265a7a4d41" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -105,13 +105,13 @@ | |
| 105 | ** |
| 106 | ** See also: [sqlite3_libversion()], |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.5" |
| 111 | #define SQLITE_VERSION_NUMBER 3008005 |
| 112 | #define SQLITE_SOURCE_ID "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -105,13 +105,13 @@ | |
| 105 | ** |
| 106 | ** See also: [sqlite3_libversion()], |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.6" |
| 111 | #define SQLITE_VERSION_NUMBER 3008006 |
| 112 | #define SQLITE_SOURCE_ID "2014-07-01 11:54:02 21981e35062cc6b30e9576786cbf55265a7a4d41" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
+13
-2
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -49,10 +49,11 @@ | ||
| 49 | 49 | int n, m; |
| 50 | 50 | int szMax, szAvg; |
| 51 | 51 | const char *zDb; |
| 52 | 52 | int brief; |
| 53 | 53 | char zBuf[100]; |
| 54 | + const char *p; | |
| 54 | 55 | |
| 55 | 56 | login_check_credentials(); |
| 56 | 57 | if( !g.perm.Read ){ login_needed(); return; } |
| 57 | 58 | brief = P("brief")!=0; |
| 58 | 59 | style_header("Repository Statistics"); |
| @@ -120,11 +121,15 @@ | ||
| 120 | 121 | @ <tr><th>Duration Of Project:</th><td> |
| 121 | 122 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 122 | 123 | " + 0.99"); |
| 123 | 124 | @ %d(n) days or approximately %.2f(n/365.2425) years. |
| 124 | 125 | @ </td></tr> |
| 125 | - @ <tr><th>Project ID:</th><td>%h(db_get("project-code",""))</td></tr> | |
| 126 | + p = db_get("project-code", 0); | |
| 127 | + if( p ){ | |
| 128 | + @ <tr><th>Project ID:</th><td>%h(p)</td></tr> | |
| 129 | + } | |
| 130 | + @ <tr><th>Server ID:</th><td>%h(db_get("server-code",""))</td></tr> | |
| 126 | 131 | @ <tr><th>Fossil Version:</th><td> |
| 127 | 132 | @ %h(MANIFEST_DATE) %h(MANIFEST_VERSION) |
| 128 | 133 | @ (%h(RELEASE_VERSION)) [compiled using %h(COMPILER_NAME)] |
| 129 | 134 | @ </td></tr> |
| 130 | 135 | @ <tr><th>SQLite Version:</th><td>%.19s(sqlite3_sourceid()) |
| @@ -163,10 +168,12 @@ | ||
| 163 | 168 | int szMax, szAvg; |
| 164 | 169 | const char *zDb; |
| 165 | 170 | int brief; |
| 166 | 171 | char zBuf[100]; |
| 167 | 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | + const char *p; | |
| 174 | + | |
| 168 | 175 | brief = find_option("brief", "b",0)!=0; |
| 169 | 176 | db_find_and_open_repository(0,0); |
| 170 | 177 | fsize = file_size(g.zRepositoryName); |
| 171 | 178 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 172 | 179 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| @@ -219,11 +226,15 @@ | ||
| 219 | 226 | } |
| 220 | 227 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 221 | 228 | " + 0.99"); |
| 222 | 229 | fossil_print("%*s%d days or approximately %.2f years.\n", |
| 223 | 230 | colWidth, "project-age:", n, n/365.2425); |
| 224 | - fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code","")); | |
| 231 | + p = db_get("project-code", 0); | |
| 232 | + if( p ){ | |
| 233 | + fossil_print("%*s%s\n", colWidth, "project-id:", p); | |
| 234 | + } | |
| 235 | + fossil_print("%*s%s\n", colWidth, "server-id:", db_get("server-code", 0)); | |
| 225 | 236 | fossil_print("%*s%s %s [%s] (%s)\n", |
| 226 | 237 | colWidth, "fossil-version:", |
| 227 | 238 | MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION, |
| 228 | 239 | COMPILER_NAME); |
| 229 | 240 | fossil_print("%*s%.19s [%.10s] (%s)\n", |
| 230 | 241 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | int n, m; |
| 50 | int szMax, szAvg; |
| 51 | const char *zDb; |
| 52 | int brief; |
| 53 | char zBuf[100]; |
| 54 | |
| 55 | login_check_credentials(); |
| 56 | if( !g.perm.Read ){ login_needed(); return; } |
| 57 | brief = P("brief")!=0; |
| 58 | style_header("Repository Statistics"); |
| @@ -120,11 +121,15 @@ | |
| 120 | @ <tr><th>Duration Of Project:</th><td> |
| 121 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 122 | " + 0.99"); |
| 123 | @ %d(n) days or approximately %.2f(n/365.2425) years. |
| 124 | @ </td></tr> |
| 125 | @ <tr><th>Project ID:</th><td>%h(db_get("project-code",""))</td></tr> |
| 126 | @ <tr><th>Fossil Version:</th><td> |
| 127 | @ %h(MANIFEST_DATE) %h(MANIFEST_VERSION) |
| 128 | @ (%h(RELEASE_VERSION)) [compiled using %h(COMPILER_NAME)] |
| 129 | @ </td></tr> |
| 130 | @ <tr><th>SQLite Version:</th><td>%.19s(sqlite3_sourceid()) |
| @@ -163,10 +168,12 @@ | |
| 163 | int szMax, szAvg; |
| 164 | const char *zDb; |
| 165 | int brief; |
| 166 | char zBuf[100]; |
| 167 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 168 | brief = find_option("brief", "b",0)!=0; |
| 169 | db_find_and_open_repository(0,0); |
| 170 | fsize = file_size(g.zRepositoryName); |
| 171 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 172 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| @@ -219,11 +226,15 @@ | |
| 219 | } |
| 220 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 221 | " + 0.99"); |
| 222 | fossil_print("%*s%d days or approximately %.2f years.\n", |
| 223 | colWidth, "project-age:", n, n/365.2425); |
| 224 | fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code","")); |
| 225 | fossil_print("%*s%s %s [%s] (%s)\n", |
| 226 | colWidth, "fossil-version:", |
| 227 | MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION, |
| 228 | COMPILER_NAME); |
| 229 | fossil_print("%*s%.19s [%.10s] (%s)\n", |
| 230 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | int n, m; |
| 50 | int szMax, szAvg; |
| 51 | const char *zDb; |
| 52 | int brief; |
| 53 | char zBuf[100]; |
| 54 | const char *p; |
| 55 | |
| 56 | login_check_credentials(); |
| 57 | if( !g.perm.Read ){ login_needed(); return; } |
| 58 | brief = P("brief")!=0; |
| 59 | style_header("Repository Statistics"); |
| @@ -120,11 +121,15 @@ | |
| 121 | @ <tr><th>Duration Of Project:</th><td> |
| 122 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 123 | " + 0.99"); |
| 124 | @ %d(n) days or approximately %.2f(n/365.2425) years. |
| 125 | @ </td></tr> |
| 126 | p = db_get("project-code", 0); |
| 127 | if( p ){ |
| 128 | @ <tr><th>Project ID:</th><td>%h(p)</td></tr> |
| 129 | } |
| 130 | @ <tr><th>Server ID:</th><td>%h(db_get("server-code",""))</td></tr> |
| 131 | @ <tr><th>Fossil Version:</th><td> |
| 132 | @ %h(MANIFEST_DATE) %h(MANIFEST_VERSION) |
| 133 | @ (%h(RELEASE_VERSION)) [compiled using %h(COMPILER_NAME)] |
| 134 | @ </td></tr> |
| 135 | @ <tr><th>SQLite Version:</th><td>%.19s(sqlite3_sourceid()) |
| @@ -163,10 +168,12 @@ | |
| 168 | int szMax, szAvg; |
| 169 | const char *zDb; |
| 170 | int brief; |
| 171 | char zBuf[100]; |
| 172 | const int colWidth = -19 /* printf alignment/width for left column */; |
| 173 | const char *p; |
| 174 | |
| 175 | brief = find_option("brief", "b",0)!=0; |
| 176 | db_find_and_open_repository(0,0); |
| 177 | fsize = file_size(g.zRepositoryName); |
| 178 | bigSizeName(sizeof(zBuf), zBuf, fsize); |
| 179 | fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf ); |
| @@ -219,11 +226,15 @@ | |
| 226 | } |
| 227 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 228 | " + 0.99"); |
| 229 | fossil_print("%*s%d days or approximately %.2f years.\n", |
| 230 | colWidth, "project-age:", n, n/365.2425); |
| 231 | p = db_get("project-code", 0); |
| 232 | if( p ){ |
| 233 | fossil_print("%*s%s\n", colWidth, "project-id:", p); |
| 234 | } |
| 235 | fossil_print("%*s%s\n", colWidth, "server-id:", db_get("server-code", 0)); |
| 236 | fossil_print("%*s%s %s [%s] (%s)\n", |
| 237 | colWidth, "fossil-version:", |
| 238 | MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION, |
| 239 | COMPILER_NAME); |
| 240 | fossil_print("%*s%.19s [%.10s] (%s)\n", |
| 241 |
+42
-43
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -20,41 +20,19 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include <string.h> |
| 23 | 23 | #include <time.h> |
| 24 | 24 | #include "timeline.h" |
| 25 | - | |
| 26 | -/* | |
| 27 | -** Shorten a UUID so that is the minimum length needed to contain | |
| 28 | -** at least one digit in the range 'a'..'f'. The minimum length is 10. | |
| 29 | -*/ | |
| 30 | -static void shorten_uuid(char *zDest, const char *zSrc){ | |
| 31 | - int i; | |
| 32 | - for(i=0; i<10 && zSrc[i]<='9'; i++){} | |
| 33 | - memcpy(zDest, zSrc, 10); | |
| 34 | - if( i==10 && zSrc[i] ){ | |
| 35 | - do{ | |
| 36 | - zDest[i] = zSrc[i]; | |
| 37 | - i++; | |
| 38 | - }while( zSrc[i-1]<='9' ); | |
| 39 | - }else{ | |
| 40 | - i = 10; | |
| 41 | - } | |
| 42 | - zDest[i] = 0; | |
| 43 | -} | |
| 44 | - | |
| 45 | 25 | |
| 46 | 26 | /* |
| 47 | 27 | ** Generate a hyperlink to a version. |
| 48 | 28 | */ |
| 49 | 29 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | - char z[UUID_SIZE+1]; | |
| 51 | - shorten_uuid(z, zUuid); | |
| 52 | 30 | if( g.perm.Hyperlink ){ |
| 53 | - @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%s(z)]</a> | |
| 31 | + @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%S(zUuid)]</a> | |
| 54 | 32 | }else{ |
| 55 | - @ <span class="timelineHistDsp">[%s(z)]</span> | |
| 33 | + @ <span class="timelineHistDsp">[%S(zUuid)]</span> | |
| 56 | 34 | } |
| 57 | 35 | } |
| 58 | 36 | |
| 59 | 37 | /* |
| 60 | 38 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | ||
| 1220 | 1198 | blob_appendf(&desc, "%d ancestors", np); |
| 1221 | 1199 | db_multi_exec("%s", blob_str(&sql)); |
| 1222 | 1200 | } |
| 1223 | 1201 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1224 | 1202 | } |
| 1225 | - blob_appendf(&desc, " of %z[%.10s]</a>", | |
| 1203 | + blob_appendf(&desc, " of %z[%S]</a>", | |
| 1226 | 1204 | href("%R/info/%s", zUuid), zUuid); |
| 1227 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1228 | - if( p_rid ){ | |
| 1229 | - url_add_parameter(&url, "p", zUuid); | |
| 1230 | - } | |
| 1231 | - if( d_rid ){ | |
| 1232 | - if( p_rid ){ | |
| 1233 | - /* If both p= and d= are set, we don't have the uuid of d yet. */ | |
| 1234 | - zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); | |
| 1235 | - } | |
| 1236 | - url_add_parameter(&url, "d", zUuid); | |
| 1237 | - } | |
| 1205 | + if( p_rid ){ | |
| 1206 | + url_add_parameter(&url, "p", zUuid); | |
| 1207 | + } | |
| 1208 | + if( d_rid ){ | |
| 1209 | + if( p_rid ){ | |
| 1210 | + /* If both p= and d= are set, we don't have the uuid of d yet. */ | |
| 1211 | + zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); | |
| 1212 | + } | |
| 1213 | + url_add_parameter(&url, "d", zUuid); | |
| 1214 | + } | |
| 1215 | + if( nEntry>20 ){ | |
| 1216 | + timeline_submenu(&url, "20 Entries", "n", "20", 0); | |
| 1217 | + } | |
| 1218 | + if( nEntry<200 ){ | |
| 1219 | + timeline_submenu(&url, "200 Entries", "n", "200", 0); | |
| 1220 | + } | |
| 1221 | + if( tmFlags & TIMELINE_FCHANGES ){ | |
| 1222 | + timeline_submenu(&url, "Hide Files", "v", 0, 0); | |
| 1223 | + }else{ | |
| 1224 | + timeline_submenu(&url, "Show Files", "v", "", 0); | |
| 1225 | + } | |
| 1226 | + if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1238 | 1227 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1239 | 1228 | } |
| 1240 | 1229 | }else if( f_rid && g.perm.Read ){ |
| 1241 | 1230 | /* If f= is present, ignore all other parameters other than n= */ |
| 1242 | 1231 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | ||
| 1250 | 1239 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1251 | 1240 | db_multi_exec("%s", blob_str(&sql)); |
| 1252 | 1241 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1253 | 1242 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1254 | 1243 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1255 | - blob_appendf(&desc, "%z[%.10s]</a>", href("%R/info/%s", zUuid), zUuid); | |
| 1244 | + blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%s", zUuid), zUuid); | |
| 1256 | 1245 | tmFlags |= TIMELINE_DISJOINT; |
| 1246 | + url_add_parameter(&url, "f", zUuid); | |
| 1247 | + if( tmFlags & TIMELINE_FCHANGES ){ | |
| 1248 | + timeline_submenu(&url, "Hide Files", "v", 0, 0); | |
| 1249 | + }else{ | |
| 1250 | + timeline_submenu(&url, "Show Files", "v", "", 0); | |
| 1251 | + } | |
| 1257 | 1252 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1258 | - url_add_parameter(&url, "f", zUuid); | |
| 1259 | 1253 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1260 | 1254 | } |
| 1261 | 1255 | }else{ |
| 1262 | 1256 | /* Otherwise, a timeline based on a span of time */ |
| 1263 | 1257 | int n; |
| @@ -1571,11 +1565,10 @@ | ||
| 1571 | 1565 | int nChild = db_column_int(q, 4); |
| 1572 | 1566 | int nParent = db_column_int(q, 5); |
| 1573 | 1567 | char *zFree = 0; |
| 1574 | 1568 | int n = 0; |
| 1575 | 1569 | char zPrefix[80]; |
| 1576 | - char zUuid[UUID_SIZE+1]; | |
| 1577 | 1570 | |
| 1578 | 1571 | if( nAbsLimit!=0 ){ |
| 1579 | 1572 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1580 | 1573 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1581 | 1574 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | ||
| 1582 | 1575 | }else if( nEntry>=nAbsLimit ){ |
| 1583 | 1576 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1584 | 1577 | break; /* entry count limit hit, stop. */ |
| 1585 | 1578 | } |
| 1586 | 1579 | } |
| 1587 | - sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); | |
| 1588 | 1580 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1589 | 1581 | fossil_print("=== %.10s ===\n", zDate); |
| 1590 | 1582 | memcpy(zPrevDate, zDate, 10); |
| 1591 | 1583 | nLine++; /* record another line */ |
| 1592 | 1584 | } |
| @@ -1609,14 +1601,14 @@ | ||
| 1609 | 1601 | } |
| 1610 | 1602 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1611 | 1603 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1612 | 1604 | n += strlen(zPrefix); |
| 1613 | 1605 | } |
| 1614 | - zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); | |
| 1606 | + zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom); | |
| 1615 | 1607 | /* record another X lines */ |
| 1616 | 1608 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1617 | - sqlite3_free(zFree); | |
| 1609 | + fossil_free(zFree); | |
| 1618 | 1610 | |
| 1619 | 1611 | if(verboseFlag){ |
| 1620 | 1612 | if( !fchngQueryInit ){ |
| 1621 | 1613 | db_prepare(&fchngQuery, |
| 1622 | 1614 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | ||
| 2052 | 2044 | static const char * stats_report_label_for_type(){ |
| 2053 | 2045 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | 2046 | switch( statsReportType ){ |
| 2055 | 2047 | case 'c': |
| 2056 | 2048 | return "checkins"; |
| 2049 | + case 'e': | |
| 2050 | + return "events"; | |
| 2057 | 2051 | case 'w': |
| 2058 | 2052 | return "wiki changes"; |
| 2059 | 2053 | case 't': |
| 2060 | 2054 | return "ticket changes"; |
| 2061 | 2055 | case 'g': |
| @@ -2081,11 +2075,11 @@ | ||
| 2081 | 2075 | zParam = NULL; |
| 2082 | 2076 | } |
| 2083 | 2077 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2084 | 2078 | zParam ? "&" : "", zParam); |
| 2085 | 2079 | cgi_printf("<div>"); |
| 2086 | - cgi_printf("<span>Event types:</span> "); | |
| 2080 | + cgi_printf("<span>Types:</span> "); | |
| 2087 | 2081 | if('*' == statsReportType){ |
| 2088 | 2082 | cgi_printf(" <strong>all</strong>", zTop); |
| 2089 | 2083 | }else{ |
| 2090 | 2084 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2091 | 2085 | } |
| @@ -2092,10 +2086,15 @@ | ||
| 2092 | 2086 | if('c' == statsReportType){ |
| 2093 | 2087 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2094 | 2088 | }else{ |
| 2095 | 2089 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2096 | 2090 | } |
| 2091 | + if('e' == statsReportType){ | |
| 2092 | + cgi_printf(" <strong>events</strong>", zTop); | |
| 2093 | + }else{ | |
| 2094 | + cgi_printf(" <a href='%s&type=e'>events</a>", zTop); | |
| 2095 | + } | |
| 2097 | 2096 | if( 't' == statsReportType ){ |
| 2098 | 2097 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2099 | 2098 | }else{ |
| 2100 | 2099 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2101 | 2100 | } |
| 2102 | 2101 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,41 +20,19 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include <string.h> |
| 23 | #include <time.h> |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 29 | */ |
| 30 | static void shorten_uuid(char *zDest, const char *zSrc){ |
| 31 | int i; |
| 32 | for(i=0; i<10 && zSrc[i]<='9'; i++){} |
| 33 | memcpy(zDest, zSrc, 10); |
| 34 | if( i==10 && zSrc[i] ){ |
| 35 | do{ |
| 36 | zDest[i] = zSrc[i]; |
| 37 | i++; |
| 38 | }while( zSrc[i-1]<='9' ); |
| 39 | }else{ |
| 40 | i = 10; |
| 41 | } |
| 42 | zDest[i] = 0; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | /* |
| 47 | ** Generate a hyperlink to a version. |
| 48 | */ |
| 49 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | char z[UUID_SIZE+1]; |
| 51 | shorten_uuid(z, zUuid); |
| 52 | if( g.perm.Hyperlink ){ |
| 53 | @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%s(z)]</a> |
| 54 | }else{ |
| 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | |
| 1220 | blob_appendf(&desc, "%d ancestors", np); |
| 1221 | db_multi_exec("%s", blob_str(&sql)); |
| 1222 | } |
| 1223 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1224 | } |
| 1225 | blob_appendf(&desc, " of %z[%.10s]</a>", |
| 1226 | href("%R/info/%s", zUuid), zUuid); |
| 1227 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1228 | if( p_rid ){ |
| 1229 | url_add_parameter(&url, "p", zUuid); |
| 1230 | } |
| 1231 | if( d_rid ){ |
| 1232 | if( p_rid ){ |
| 1233 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1234 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1235 | } |
| 1236 | url_add_parameter(&url, "d", zUuid); |
| 1237 | } |
| 1238 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1239 | } |
| 1240 | }else if( f_rid && g.perm.Read ){ |
| 1241 | /* If f= is present, ignore all other parameters other than n= */ |
| 1242 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | |
| 1250 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1251 | db_multi_exec("%s", blob_str(&sql)); |
| 1252 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1253 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1254 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1255 | blob_appendf(&desc, "%z[%.10s]</a>", href("%R/info/%s", zUuid), zUuid); |
| 1256 | tmFlags |= TIMELINE_DISJOINT; |
| 1257 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1258 | url_add_parameter(&url, "f", zUuid); |
| 1259 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1260 | } |
| 1261 | }else{ |
| 1262 | /* Otherwise, a timeline based on a span of time */ |
| 1263 | int n; |
| @@ -1571,11 +1565,10 @@ | |
| 1571 | int nChild = db_column_int(q, 4); |
| 1572 | int nParent = db_column_int(q, 5); |
| 1573 | char *zFree = 0; |
| 1574 | int n = 0; |
| 1575 | char zPrefix[80]; |
| 1576 | char zUuid[UUID_SIZE+1]; |
| 1577 | |
| 1578 | if( nAbsLimit!=0 ){ |
| 1579 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1580 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1581 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | |
| 1582 | }else if( nEntry>=nAbsLimit ){ |
| 1583 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1584 | break; /* entry count limit hit, stop. */ |
| 1585 | } |
| 1586 | } |
| 1587 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1588 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1589 | fossil_print("=== %.10s ===\n", zDate); |
| 1590 | memcpy(zPrevDate, zDate, 10); |
| 1591 | nLine++; /* record another line */ |
| 1592 | } |
| @@ -1609,14 +1601,14 @@ | |
| 1609 | } |
| 1610 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1611 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1612 | n += strlen(zPrefix); |
| 1613 | } |
| 1614 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1615 | /* record another X lines */ |
| 1616 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1617 | sqlite3_free(zFree); |
| 1618 | |
| 1619 | if(verboseFlag){ |
| 1620 | if( !fchngQueryInit ){ |
| 1621 | db_prepare(&fchngQuery, |
| 1622 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | |
| 2052 | static const char * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| 2058 | return "wiki changes"; |
| 2059 | case 't': |
| 2060 | return "ticket changes"; |
| 2061 | case 'g': |
| @@ -2081,11 +2075,11 @@ | |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2084 | zParam ? "&" : "", zParam); |
| 2085 | cgi_printf("<div>"); |
| 2086 | cgi_printf("<span>Event types:</span> "); |
| 2087 | if('*' == statsReportType){ |
| 2088 | cgi_printf(" <strong>all</strong>", zTop); |
| 2089 | }else{ |
| 2090 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2091 | } |
| @@ -2092,10 +2086,15 @@ | |
| 2092 | if('c' == statsReportType){ |
| 2093 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2094 | }else{ |
| 2095 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2096 | } |
| 2097 | if( 't' == statsReportType ){ |
| 2098 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2099 | }else{ |
| 2100 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2101 | } |
| 2102 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,41 +20,19 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include <string.h> |
| 23 | #include <time.h> |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Generate a hyperlink to a version. |
| 28 | */ |
| 29 | void hyperlink_to_uuid(const char *zUuid){ |
| 30 | if( g.perm.Hyperlink ){ |
| 31 | @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%S(zUuid)]</a> |
| 32 | }else{ |
| 33 | @ <span class="timelineHistDsp">[%S(zUuid)]</span> |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /* |
| 38 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | |
| 1198 | blob_appendf(&desc, "%d ancestors", np); |
| 1199 | db_multi_exec("%s", blob_str(&sql)); |
| 1200 | } |
| 1201 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1202 | } |
| 1203 | blob_appendf(&desc, " of %z[%S]</a>", |
| 1204 | href("%R/info/%s", zUuid), zUuid); |
| 1205 | if( p_rid ){ |
| 1206 | url_add_parameter(&url, "p", zUuid); |
| 1207 | } |
| 1208 | if( d_rid ){ |
| 1209 | if( p_rid ){ |
| 1210 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1211 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1212 | } |
| 1213 | url_add_parameter(&url, "d", zUuid); |
| 1214 | } |
| 1215 | if( nEntry>20 ){ |
| 1216 | timeline_submenu(&url, "20 Entries", "n", "20", 0); |
| 1217 | } |
| 1218 | if( nEntry<200 ){ |
| 1219 | timeline_submenu(&url, "200 Entries", "n", "200", 0); |
| 1220 | } |
| 1221 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1222 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1223 | }else{ |
| 1224 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1225 | } |
| 1226 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1227 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1228 | } |
| 1229 | }else if( f_rid && g.perm.Read ){ |
| 1230 | /* If f= is present, ignore all other parameters other than n= */ |
| 1231 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | |
| 1239 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1240 | db_multi_exec("%s", blob_str(&sql)); |
| 1241 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1242 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1243 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1244 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%s", zUuid), zUuid); |
| 1245 | tmFlags |= TIMELINE_DISJOINT; |
| 1246 | url_add_parameter(&url, "f", zUuid); |
| 1247 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1248 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1249 | }else{ |
| 1250 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1251 | } |
| 1252 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1253 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1254 | } |
| 1255 | }else{ |
| 1256 | /* Otherwise, a timeline based on a span of time */ |
| 1257 | int n; |
| @@ -1571,11 +1565,10 @@ | |
| 1565 | int nChild = db_column_int(q, 4); |
| 1566 | int nParent = db_column_int(q, 5); |
| 1567 | char *zFree = 0; |
| 1568 | int n = 0; |
| 1569 | char zPrefix[80]; |
| 1570 | |
| 1571 | if( nAbsLimit!=0 ){ |
| 1572 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1573 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1574 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | |
| 1575 | }else if( nEntry>=nAbsLimit ){ |
| 1576 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1577 | break; /* entry count limit hit, stop. */ |
| 1578 | } |
| 1579 | } |
| 1580 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1581 | fossil_print("=== %.10s ===\n", zDate); |
| 1582 | memcpy(zPrevDate, zDate, 10); |
| 1583 | nLine++; /* record another line */ |
| 1584 | } |
| @@ -1609,14 +1601,14 @@ | |
| 1601 | } |
| 1602 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1603 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1604 | n += strlen(zPrefix); |
| 1605 | } |
| 1606 | zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom); |
| 1607 | /* record another X lines */ |
| 1608 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1609 | fossil_free(zFree); |
| 1610 | |
| 1611 | if(verboseFlag){ |
| 1612 | if( !fchngQueryInit ){ |
| 1613 | db_prepare(&fchngQuery, |
| 1614 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | |
| 2044 | static const char * stats_report_label_for_type(){ |
| 2045 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2046 | switch( statsReportType ){ |
| 2047 | case 'c': |
| 2048 | return "checkins"; |
| 2049 | case 'e': |
| 2050 | return "events"; |
| 2051 | case 'w': |
| 2052 | return "wiki changes"; |
| 2053 | case 't': |
| 2054 | return "ticket changes"; |
| 2055 | case 'g': |
| @@ -2081,11 +2075,11 @@ | |
| 2075 | zParam = NULL; |
| 2076 | } |
| 2077 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2078 | zParam ? "&" : "", zParam); |
| 2079 | cgi_printf("<div>"); |
| 2080 | cgi_printf("<span>Types:</span> "); |
| 2081 | if('*' == statsReportType){ |
| 2082 | cgi_printf(" <strong>all</strong>", zTop); |
| 2083 | }else{ |
| 2084 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2085 | } |
| @@ -2092,10 +2086,15 @@ | |
| 2086 | if('c' == statsReportType){ |
| 2087 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2088 | }else{ |
| 2089 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2090 | } |
| 2091 | if('e' == statsReportType){ |
| 2092 | cgi_printf(" <strong>events</strong>", zTop); |
| 2093 | }else{ |
| 2094 | cgi_printf(" <a href='%s&type=e'>events</a>", zTop); |
| 2095 | } |
| 2096 | if( 't' == statsReportType ){ |
| 2097 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2098 | }else{ |
| 2099 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2100 | } |
| 2101 |
+42
-43
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -20,41 +20,19 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include <string.h> |
| 23 | 23 | #include <time.h> |
| 24 | 24 | #include "timeline.h" |
| 25 | - | |
| 26 | -/* | |
| 27 | -** Shorten a UUID so that is the minimum length needed to contain | |
| 28 | -** at least one digit in the range 'a'..'f'. The minimum length is 10. | |
| 29 | -*/ | |
| 30 | -static void shorten_uuid(char *zDest, const char *zSrc){ | |
| 31 | - int i; | |
| 32 | - for(i=0; i<10 && zSrc[i]<='9'; i++){} | |
| 33 | - memcpy(zDest, zSrc, 10); | |
| 34 | - if( i==10 && zSrc[i] ){ | |
| 35 | - do{ | |
| 36 | - zDest[i] = zSrc[i]; | |
| 37 | - i++; | |
| 38 | - }while( zSrc[i-1]<='9' ); | |
| 39 | - }else{ | |
| 40 | - i = 10; | |
| 41 | - } | |
| 42 | - zDest[i] = 0; | |
| 43 | -} | |
| 44 | - | |
| 45 | 25 | |
| 46 | 26 | /* |
| 47 | 27 | ** Generate a hyperlink to a version. |
| 48 | 28 | */ |
| 49 | 29 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | - char z[UUID_SIZE+1]; | |
| 51 | - shorten_uuid(z, zUuid); | |
| 52 | 30 | if( g.perm.Hyperlink ){ |
| 53 | - @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%s(z)]</a> | |
| 31 | + @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%S(zUuid)]</a> | |
| 54 | 32 | }else{ |
| 55 | - @ <span class="timelineHistDsp">[%s(z)]</span> | |
| 33 | + @ <span class="timelineHistDsp">[%S(zUuid)]</span> | |
| 56 | 34 | } |
| 57 | 35 | } |
| 58 | 36 | |
| 59 | 37 | /* |
| 60 | 38 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | ||
| 1220 | 1198 | blob_appendf(&desc, "%d ancestors", np); |
| 1221 | 1199 | db_multi_exec("%s", blob_str(&sql)); |
| 1222 | 1200 | } |
| 1223 | 1201 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1224 | 1202 | } |
| 1225 | - blob_appendf(&desc, " of %z[%.10s]</a>", | |
| 1203 | + blob_appendf(&desc, " of %z[%S]</a>", | |
| 1226 | 1204 | href("%R/info/%s", zUuid), zUuid); |
| 1227 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1228 | - if( p_rid ){ | |
| 1229 | - url_add_parameter(&url, "p", zUuid); | |
| 1230 | - } | |
| 1231 | - if( d_rid ){ | |
| 1232 | - if( p_rid ){ | |
| 1233 | - /* If both p= and d= are set, we don't have the uuid of d yet. */ | |
| 1234 | - zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); | |
| 1235 | - } | |
| 1236 | - url_add_parameter(&url, "d", zUuid); | |
| 1237 | - } | |
| 1205 | + if( p_rid ){ | |
| 1206 | + url_add_parameter(&url, "p", zUuid); | |
| 1207 | + } | |
| 1208 | + if( d_rid ){ | |
| 1209 | + if( p_rid ){ | |
| 1210 | + /* If both p= and d= are set, we don't have the uuid of d yet. */ | |
| 1211 | + zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); | |
| 1212 | + } | |
| 1213 | + url_add_parameter(&url, "d", zUuid); | |
| 1214 | + } | |
| 1215 | + if( nEntry>20 ){ | |
| 1216 | + timeline_submenu(&url, "20 Entries", "n", "20", 0); | |
| 1217 | + } | |
| 1218 | + if( nEntry<200 ){ | |
| 1219 | + timeline_submenu(&url, "200 Entries", "n", "200", 0); | |
| 1220 | + } | |
| 1221 | + if( tmFlags & TIMELINE_FCHANGES ){ | |
| 1222 | + timeline_submenu(&url, "Hide Files", "v", 0, 0); | |
| 1223 | + }else{ | |
| 1224 | + timeline_submenu(&url, "Show Files", "v", "", 0); | |
| 1225 | + } | |
| 1226 | + if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1238 | 1227 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1239 | 1228 | } |
| 1240 | 1229 | }else if( f_rid && g.perm.Read ){ |
| 1241 | 1230 | /* If f= is present, ignore all other parameters other than n= */ |
| 1242 | 1231 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | ||
| 1250 | 1239 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1251 | 1240 | db_multi_exec("%s", blob_str(&sql)); |
| 1252 | 1241 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1253 | 1242 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1254 | 1243 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1255 | - blob_appendf(&desc, "%z[%.10s]</a>", href("%R/info/%s", zUuid), zUuid); | |
| 1244 | + blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%s", zUuid), zUuid); | |
| 1256 | 1245 | tmFlags |= TIMELINE_DISJOINT; |
| 1246 | + url_add_parameter(&url, "f", zUuid); | |
| 1247 | + if( tmFlags & TIMELINE_FCHANGES ){ | |
| 1248 | + timeline_submenu(&url, "Hide Files", "v", 0, 0); | |
| 1249 | + }else{ | |
| 1250 | + timeline_submenu(&url, "Show Files", "v", "", 0); | |
| 1251 | + } | |
| 1257 | 1252 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1258 | - url_add_parameter(&url, "f", zUuid); | |
| 1259 | 1253 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1260 | 1254 | } |
| 1261 | 1255 | }else{ |
| 1262 | 1256 | /* Otherwise, a timeline based on a span of time */ |
| 1263 | 1257 | int n; |
| @@ -1571,11 +1565,10 @@ | ||
| 1571 | 1565 | int nChild = db_column_int(q, 4); |
| 1572 | 1566 | int nParent = db_column_int(q, 5); |
| 1573 | 1567 | char *zFree = 0; |
| 1574 | 1568 | int n = 0; |
| 1575 | 1569 | char zPrefix[80]; |
| 1576 | - char zUuid[UUID_SIZE+1]; | |
| 1577 | 1570 | |
| 1578 | 1571 | if( nAbsLimit!=0 ){ |
| 1579 | 1572 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1580 | 1573 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1581 | 1574 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | ||
| 1582 | 1575 | }else if( nEntry>=nAbsLimit ){ |
| 1583 | 1576 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1584 | 1577 | break; /* entry count limit hit, stop. */ |
| 1585 | 1578 | } |
| 1586 | 1579 | } |
| 1587 | - sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); | |
| 1588 | 1580 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1589 | 1581 | fossil_print("=== %.10s ===\n", zDate); |
| 1590 | 1582 | memcpy(zPrevDate, zDate, 10); |
| 1591 | 1583 | nLine++; /* record another line */ |
| 1592 | 1584 | } |
| @@ -1609,14 +1601,14 @@ | ||
| 1609 | 1601 | } |
| 1610 | 1602 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1611 | 1603 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1612 | 1604 | n += strlen(zPrefix); |
| 1613 | 1605 | } |
| 1614 | - zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); | |
| 1606 | + zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom); | |
| 1615 | 1607 | /* record another X lines */ |
| 1616 | 1608 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1617 | - sqlite3_free(zFree); | |
| 1609 | + fossil_free(zFree); | |
| 1618 | 1610 | |
| 1619 | 1611 | if(verboseFlag){ |
| 1620 | 1612 | if( !fchngQueryInit ){ |
| 1621 | 1613 | db_prepare(&fchngQuery, |
| 1622 | 1614 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | ||
| 2052 | 2044 | static const char * stats_report_label_for_type(){ |
| 2053 | 2045 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | 2046 | switch( statsReportType ){ |
| 2055 | 2047 | case 'c': |
| 2056 | 2048 | return "checkins"; |
| 2049 | + case 'e': | |
| 2050 | + return "events"; | |
| 2057 | 2051 | case 'w': |
| 2058 | 2052 | return "wiki changes"; |
| 2059 | 2053 | case 't': |
| 2060 | 2054 | return "ticket changes"; |
| 2061 | 2055 | case 'g': |
| @@ -2081,11 +2075,11 @@ | ||
| 2081 | 2075 | zParam = NULL; |
| 2082 | 2076 | } |
| 2083 | 2077 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2084 | 2078 | zParam ? "&" : "", zParam); |
| 2085 | 2079 | cgi_printf("<div>"); |
| 2086 | - cgi_printf("<span>Event types:</span> "); | |
| 2080 | + cgi_printf("<span>Types:</span> "); | |
| 2087 | 2081 | if('*' == statsReportType){ |
| 2088 | 2082 | cgi_printf(" <strong>all</strong>", zTop); |
| 2089 | 2083 | }else{ |
| 2090 | 2084 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2091 | 2085 | } |
| @@ -2092,10 +2086,15 @@ | ||
| 2092 | 2086 | if('c' == statsReportType){ |
| 2093 | 2087 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2094 | 2088 | }else{ |
| 2095 | 2089 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2096 | 2090 | } |
| 2091 | + if('e' == statsReportType){ | |
| 2092 | + cgi_printf(" <strong>events</strong>", zTop); | |
| 2093 | + }else{ | |
| 2094 | + cgi_printf(" <a href='%s&type=e'>events</a>", zTop); | |
| 2095 | + } | |
| 2097 | 2096 | if( 't' == statsReportType ){ |
| 2098 | 2097 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2099 | 2098 | }else{ |
| 2100 | 2099 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2101 | 2100 | } |
| 2102 | 2101 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,41 +20,19 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include <string.h> |
| 23 | #include <time.h> |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Shorten a UUID so that is the minimum length needed to contain |
| 28 | ** at least one digit in the range 'a'..'f'. The minimum length is 10. |
| 29 | */ |
| 30 | static void shorten_uuid(char *zDest, const char *zSrc){ |
| 31 | int i; |
| 32 | for(i=0; i<10 && zSrc[i]<='9'; i++){} |
| 33 | memcpy(zDest, zSrc, 10); |
| 34 | if( i==10 && zSrc[i] ){ |
| 35 | do{ |
| 36 | zDest[i] = zSrc[i]; |
| 37 | i++; |
| 38 | }while( zSrc[i-1]<='9' ); |
| 39 | }else{ |
| 40 | i = 10; |
| 41 | } |
| 42 | zDest[i] = 0; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | /* |
| 47 | ** Generate a hyperlink to a version. |
| 48 | */ |
| 49 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | char z[UUID_SIZE+1]; |
| 51 | shorten_uuid(z, zUuid); |
| 52 | if( g.perm.Hyperlink ){ |
| 53 | @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%s(z)]</a> |
| 54 | }else{ |
| 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | |
| 1220 | blob_appendf(&desc, "%d ancestors", np); |
| 1221 | db_multi_exec("%s", blob_str(&sql)); |
| 1222 | } |
| 1223 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1224 | } |
| 1225 | blob_appendf(&desc, " of %z[%.10s]</a>", |
| 1226 | href("%R/info/%s", zUuid), zUuid); |
| 1227 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1228 | if( p_rid ){ |
| 1229 | url_add_parameter(&url, "p", zUuid); |
| 1230 | } |
| 1231 | if( d_rid ){ |
| 1232 | if( p_rid ){ |
| 1233 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1234 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1235 | } |
| 1236 | url_add_parameter(&url, "d", zUuid); |
| 1237 | } |
| 1238 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1239 | } |
| 1240 | }else if( f_rid && g.perm.Read ){ |
| 1241 | /* If f= is present, ignore all other parameters other than n= */ |
| 1242 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | |
| 1250 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1251 | db_multi_exec("%s", blob_str(&sql)); |
| 1252 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1253 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1254 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1255 | blob_appendf(&desc, "%z[%.10s]</a>", href("%R/info/%s", zUuid), zUuid); |
| 1256 | tmFlags |= TIMELINE_DISJOINT; |
| 1257 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1258 | url_add_parameter(&url, "f", zUuid); |
| 1259 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1260 | } |
| 1261 | }else{ |
| 1262 | /* Otherwise, a timeline based on a span of time */ |
| 1263 | int n; |
| @@ -1571,11 +1565,10 @@ | |
| 1571 | int nChild = db_column_int(q, 4); |
| 1572 | int nParent = db_column_int(q, 5); |
| 1573 | char *zFree = 0; |
| 1574 | int n = 0; |
| 1575 | char zPrefix[80]; |
| 1576 | char zUuid[UUID_SIZE+1]; |
| 1577 | |
| 1578 | if( nAbsLimit!=0 ){ |
| 1579 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1580 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1581 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | |
| 1582 | }else if( nEntry>=nAbsLimit ){ |
| 1583 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1584 | break; /* entry count limit hit, stop. */ |
| 1585 | } |
| 1586 | } |
| 1587 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1588 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1589 | fossil_print("=== %.10s ===\n", zDate); |
| 1590 | memcpy(zPrevDate, zDate, 10); |
| 1591 | nLine++; /* record another line */ |
| 1592 | } |
| @@ -1609,14 +1601,14 @@ | |
| 1609 | } |
| 1610 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1611 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1612 | n += strlen(zPrefix); |
| 1613 | } |
| 1614 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1615 | /* record another X lines */ |
| 1616 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1617 | sqlite3_free(zFree); |
| 1618 | |
| 1619 | if(verboseFlag){ |
| 1620 | if( !fchngQueryInit ){ |
| 1621 | db_prepare(&fchngQuery, |
| 1622 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | |
| 2052 | static const char * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| 2058 | return "wiki changes"; |
| 2059 | case 't': |
| 2060 | return "ticket changes"; |
| 2061 | case 'g': |
| @@ -2081,11 +2075,11 @@ | |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2084 | zParam ? "&" : "", zParam); |
| 2085 | cgi_printf("<div>"); |
| 2086 | cgi_printf("<span>Event types:</span> "); |
| 2087 | if('*' == statsReportType){ |
| 2088 | cgi_printf(" <strong>all</strong>", zTop); |
| 2089 | }else{ |
| 2090 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2091 | } |
| @@ -2092,10 +2086,15 @@ | |
| 2092 | if('c' == statsReportType){ |
| 2093 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2094 | }else{ |
| 2095 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2096 | } |
| 2097 | if( 't' == statsReportType ){ |
| 2098 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2099 | }else{ |
| 2100 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2101 | } |
| 2102 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -20,41 +20,19 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include <string.h> |
| 23 | #include <time.h> |
| 24 | #include "timeline.h" |
| 25 | |
| 26 | /* |
| 27 | ** Generate a hyperlink to a version. |
| 28 | */ |
| 29 | void hyperlink_to_uuid(const char *zUuid){ |
| 30 | if( g.perm.Hyperlink ){ |
| 31 | @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%S(zUuid)]</a> |
| 32 | }else{ |
| 33 | @ <span class="timelineHistDsp">[%S(zUuid)]</span> |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /* |
| 38 | ** Generate a hyperlink to a date & time. |
| @@ -1220,23 +1198,34 @@ | |
| 1198 | blob_appendf(&desc, "%d ancestors", np); |
| 1199 | db_multi_exec("%s", blob_str(&sql)); |
| 1200 | } |
| 1201 | if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid); |
| 1202 | } |
| 1203 | blob_appendf(&desc, " of %z[%S]</a>", |
| 1204 | href("%R/info/%s", zUuid), zUuid); |
| 1205 | if( p_rid ){ |
| 1206 | url_add_parameter(&url, "p", zUuid); |
| 1207 | } |
| 1208 | if( d_rid ){ |
| 1209 | if( p_rid ){ |
| 1210 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1211 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1212 | } |
| 1213 | url_add_parameter(&url, "d", zUuid); |
| 1214 | } |
| 1215 | if( nEntry>20 ){ |
| 1216 | timeline_submenu(&url, "20 Entries", "n", "20", 0); |
| 1217 | } |
| 1218 | if( nEntry<200 ){ |
| 1219 | timeline_submenu(&url, "200 Entries", "n", "200", 0); |
| 1220 | } |
| 1221 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1222 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1223 | }else{ |
| 1224 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1225 | } |
| 1226 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1227 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1228 | } |
| 1229 | }else if( f_rid && g.perm.Read ){ |
| 1230 | /* If f= is present, ignore all other parameters other than n= */ |
| 1231 | char *zUuid; |
| @@ -1250,14 +1239,19 @@ | |
| 1239 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 1240 | db_multi_exec("%s", blob_str(&sql)); |
| 1241 | if( useDividers ) timeline_add_dividers(0, f_rid); |
| 1242 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1243 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1244 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%s", zUuid), zUuid); |
| 1245 | tmFlags |= TIMELINE_DISJOINT; |
| 1246 | url_add_parameter(&url, "f", zUuid); |
| 1247 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1248 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1249 | }else{ |
| 1250 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1251 | } |
| 1252 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1253 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1254 | } |
| 1255 | }else{ |
| 1256 | /* Otherwise, a timeline based on a span of time */ |
| 1257 | int n; |
| @@ -1571,11 +1565,10 @@ | |
| 1565 | int nChild = db_column_int(q, 4); |
| 1566 | int nParent = db_column_int(q, 5); |
| 1567 | char *zFree = 0; |
| 1568 | int n = 0; |
| 1569 | char zPrefix[80]; |
| 1570 | |
| 1571 | if( nAbsLimit!=0 ){ |
| 1572 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1573 | fossil_print("--- line limit (%d) reached ---\n", nAbsLimit); |
| 1574 | break; /* line count limit hit, stop. */ |
| @@ -1582,11 +1575,10 @@ | |
| 1575 | }else if( nEntry>=nAbsLimit ){ |
| 1576 | fossil_print("--- entry limit (%d) reached ---\n", nAbsLimit); |
| 1577 | break; /* entry count limit hit, stop. */ |
| 1578 | } |
| 1579 | } |
| 1580 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 1581 | fossil_print("=== %.10s ===\n", zDate); |
| 1582 | memcpy(zPrevDate, zDate, 10); |
| 1583 | nLine++; /* record another line */ |
| 1584 | } |
| @@ -1609,14 +1601,14 @@ | |
| 1601 | } |
| 1602 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1603 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1604 | n += strlen(zPrefix); |
| 1605 | } |
| 1606 | zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom); |
| 1607 | /* record another X lines */ |
| 1608 | nLine += comment_print(zFree, 9, width, COMMENT_PRINT_DEFAULT); |
| 1609 | fossil_free(zFree); |
| 1610 | |
| 1611 | if(verboseFlag){ |
| 1612 | if( !fchngQueryInit ){ |
| 1613 | db_prepare(&fchngQuery, |
| 1614 | "SELECT (pid==0) AS isnew," |
| @@ -2052,10 +2044,12 @@ | |
| 2044 | static const char * stats_report_label_for_type(){ |
| 2045 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2046 | switch( statsReportType ){ |
| 2047 | case 'c': |
| 2048 | return "checkins"; |
| 2049 | case 'e': |
| 2050 | return "events"; |
| 2051 | case 'w': |
| 2052 | return "wiki changes"; |
| 2053 | case 't': |
| 2054 | return "ticket changes"; |
| 2055 | case 'g': |
| @@ -2081,11 +2075,11 @@ | |
| 2075 | zParam = NULL; |
| 2076 | } |
| 2077 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| 2078 | zParam ? "&" : "", zParam); |
| 2079 | cgi_printf("<div>"); |
| 2080 | cgi_printf("<span>Types:</span> "); |
| 2081 | if('*' == statsReportType){ |
| 2082 | cgi_printf(" <strong>all</strong>", zTop); |
| 2083 | }else{ |
| 2084 | cgi_printf(" <a href='%s'>all</a>", zTop); |
| 2085 | } |
| @@ -2092,10 +2086,15 @@ | |
| 2086 | if('c' == statsReportType){ |
| 2087 | cgi_printf(" <strong>checkins</strong>", zTop); |
| 2088 | }else{ |
| 2089 | cgi_printf(" <a href='%s&type=ci'>checkins</a>", zTop); |
| 2090 | } |
| 2091 | if('e' == statsReportType){ |
| 2092 | cgi_printf(" <strong>events</strong>", zTop); |
| 2093 | }else{ |
| 2094 | cgi_printf(" <a href='%s&type=e'>events</a>", zTop); |
| 2095 | } |
| 2096 | if( 't' == statsReportType ){ |
| 2097 | cgi_printf(" <strong>tickets</strong>", zTop); |
| 2098 | }else{ |
| 2099 | cgi_printf(" <a href='%s&type=t'>tickets</a>", zTop); |
| 2100 | } |
| 2101 |
+2
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -943,20 +943,20 @@ | ||
| 943 | 943 | }else{ |
| 944 | 944 | @ |
| 945 | 945 | @ <li><p>Add attachment |
| 946 | 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | 947 | } |
| 948 | - @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] | |
| 948 | + @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] | |
| 949 | 949 | @ (rid %d(rid)) by |
| 950 | 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | 952 | }else{ |
| 953 | 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | 954 | if( pTicket ){ |
| 955 | 955 | @ |
| 956 | 956 | @ <li><p>Ticket change |
| 957 | - @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] | |
| 957 | + @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] | |
| 958 | 958 | @ (rid %d(rid)) by |
| 959 | 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | 960 | hyperlink_to_date(zDate, ":"); |
| 961 | 961 | @ </p> |
| 962 | 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 | 963 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -943,20 +943,20 @@ | |
| 943 | }else{ |
| 944 | @ |
| 945 | @ <li><p>Add attachment |
| 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | } |
| 948 | @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] |
| 949 | @ (rid %d(rid)) by |
| 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | }else{ |
| 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | if( pTicket ){ |
| 955 | @ |
| 956 | @ <li><p>Ticket change |
| 957 | @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] |
| 958 | @ (rid %d(rid)) by |
| 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | hyperlink_to_date(zDate, ":"); |
| 961 | @ </p> |
| 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -943,20 +943,20 @@ | |
| 943 | }else{ |
| 944 | @ |
| 945 | @ <li><p>Add attachment |
| 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | } |
| 948 | @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] |
| 949 | @ (rid %d(rid)) by |
| 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | }else{ |
| 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | if( pTicket ){ |
| 955 | @ |
| 956 | @ <li><p>Ticket change |
| 957 | @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] |
| 958 | @ (rid %d(rid)) by |
| 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | hyperlink_to_date(zDate, ":"); |
| 961 | @ </p> |
| 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 |
+2
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -943,20 +943,20 @@ | ||
| 943 | 943 | }else{ |
| 944 | 944 | @ |
| 945 | 945 | @ <li><p>Add attachment |
| 946 | 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | 947 | } |
| 948 | - @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] | |
| 948 | + @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] | |
| 949 | 949 | @ (rid %d(rid)) by |
| 950 | 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | 952 | }else{ |
| 953 | 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | 954 | if( pTicket ){ |
| 955 | 955 | @ |
| 956 | 956 | @ <li><p>Ticket change |
| 957 | - @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] | |
| 957 | + @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] | |
| 958 | 958 | @ (rid %d(rid)) by |
| 959 | 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | 960 | hyperlink_to_date(zDate, ":"); |
| 961 | 961 | @ </p> |
| 962 | 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 | 963 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -943,20 +943,20 @@ | |
| 943 | }else{ |
| 944 | @ |
| 945 | @ <li><p>Add attachment |
| 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | } |
| 948 | @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] |
| 949 | @ (rid %d(rid)) by |
| 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | }else{ |
| 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | if( pTicket ){ |
| 955 | @ |
| 956 | @ <li><p>Ticket change |
| 957 | @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>] |
| 958 | @ (rid %d(rid)) by |
| 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | hyperlink_to_date(zDate, ":"); |
| 961 | @ </p> |
| 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -943,20 +943,20 @@ | |
| 943 | }else{ |
| 944 | @ |
| 945 | @ <li><p>Add attachment |
| 946 | @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>" |
| 947 | } |
| 948 | @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] |
| 949 | @ (rid %d(rid)) by |
| 950 | hyperlink_to_user(zUser,zDate," on"); |
| 951 | hyperlink_to_date(zDate, ".</p>"); |
| 952 | }else{ |
| 953 | pTicket = manifest_get(rid, CFTYPE_TICKET, 0); |
| 954 | if( pTicket ){ |
| 955 | @ |
| 956 | @ <li><p>Ticket change |
| 957 | @ [%z(href("%R/artifact/%s",zChngUuid))%S(zChngUuid)</a>] |
| 958 | @ (rid %d(rid)) by |
| 959 | hyperlink_to_user(pTicket->zUser,zDate," on"); |
| 960 | hyperlink_to_date(zDate, ":"); |
| 961 | @ </p> |
| 962 | ticket_output_change_artifact(pTicket, "a"); |
| 963 |
+166
-154
| --- src/unicode.c | ||
| +++ src/unicode.c | ||
| @@ -31,101 +31,107 @@ | ||
| 31 | 31 | int unicode_isalnum(int c){ |
| 32 | 32 | /* Each unsigned integer in the following array corresponds to a contiguous |
| 33 | 33 | ** range of unicode codepoints that are not either letters or numbers (i.e. |
| 34 | 34 | ** codepoints for which this function should return 0). |
| 35 | 35 | ** |
| 36 | - ** The most significant 22 bits in each 32-bit value contain the first | |
| 36 | + ** The most significant 22 bits in each 32-bit value contain the first | |
| 37 | 37 | ** codepoint in the range. The least significant 10 bits are used to store |
| 38 | - ** the size of the range (always at least 1). In other words, the value | |
| 39 | - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint | |
| 40 | - ** C. It is not possible to represent a range larger than 1023 codepoints | |
| 38 | + ** the size of the range (always at least 1). In other words, the value | |
| 39 | + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint | |
| 40 | + ** C. It is not possible to represent a range larger than 1023 codepoints | |
| 41 | 41 | ** using this format. |
| 42 | 42 | */ |
| 43 | 43 | static const unsigned int aEntry[] = { |
| 44 | 44 | 0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07, |
| 45 | 45 | 0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01, |
| 46 | 46 | 0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401, |
| 47 | 47 | 0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01, |
| 48 | - 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163C01, | |
| 49 | - 0x00164437, 0x0017CC02, 0x00180005, 0x00181816, 0x00187802, | |
| 50 | - 0x00192C15, 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, | |
| 51 | - 0x001B9C07, 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, | |
| 52 | - 0x001CC01B, 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, | |
| 53 | - 0x00206C09, 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, | |
| 54 | - 0x00217801, 0x0023901B, 0x00240004, 0x0024E803, 0x0024F812, | |
| 55 | - 0x00254407, 0x00258804, 0x0025C001, 0x00260403, 0x0026F001, | |
| 56 | - 0x0026F807, 0x00271C02, 0x00272C03, 0x00275C01, 0x00278802, | |
| 57 | - 0x0027C802, 0x0027E802, 0x00280403, 0x0028F001, 0x0028F805, | |
| 58 | - 0x00291C02, 0x00292C03, 0x00294401, 0x0029C002, 0x0029D401, | |
| 59 | - 0x002A0403, 0x002AF001, 0x002AF808, 0x002B1C03, 0x002B2C03, | |
| 60 | - 0x002B8802, 0x002BC002, 0x002C0403, 0x002CF001, 0x002CF807, | |
| 61 | - 0x002D1C02, 0x002D2C03, 0x002D5802, 0x002D8802, 0x002DC001, | |
| 62 | - 0x002E0801, 0x002EF805, 0x002F1803, 0x002F2804, 0x002F5C01, | |
| 63 | - 0x002FCC08, 0x00300403, 0x0030F807, 0x00311803, 0x00312804, | |
| 64 | - 0x00315402, 0x00318802, 0x0031FC01, 0x00320802, 0x0032F001, | |
| 65 | - 0x0032F807, 0x00331803, 0x00332804, 0x00335402, 0x00338802, | |
| 66 | - 0x00340802, 0x0034F807, 0x00351803, 0x00352804, 0x00355C01, | |
| 67 | - 0x00358802, 0x0035E401, 0x00360802, 0x00372801, 0x00373C06, | |
| 68 | - 0x00375801, 0x00376008, 0x0037C803, 0x0038C401, 0x0038D007, | |
| 69 | - 0x0038FC01, 0x00391C09, 0x00396802, 0x003AC401, 0x003AD006, | |
| 70 | - 0x003AEC02, 0x003B2006, 0x003C041F, 0x003CD00C, 0x003DC417, | |
| 71 | - 0x003E340B, 0x003E6424, 0x003EF80F, 0x003F380D, 0x0040AC14, | |
| 72 | - 0x00412806, 0x00415804, 0x00417803, 0x00418803, 0x00419C07, | |
| 73 | - 0x0041C404, 0x0042080C, 0x00423C01, 0x00426806, 0x0043EC01, | |
| 74 | - 0x004D740C, 0x004E400A, 0x00500001, 0x0059B402, 0x005A0001, | |
| 75 | - 0x005A6C02, 0x005BAC03, 0x005C4803, 0x005CC805, 0x005D4802, | |
| 76 | - 0x005DC802, 0x005ED023, 0x005F6004, 0x005F7401, 0x0060000F, | |
| 77 | - 0x0062A401, 0x0064800C, 0x0064C00C, 0x00650001, 0x00651002, | |
| 78 | - 0x0066C011, 0x00672002, 0x00677822, 0x00685C05, 0x00687802, | |
| 79 | - 0x0069540A, 0x0069801D, 0x0069FC01, 0x006A8007, 0x006AA006, | |
| 80 | - 0x006C0005, 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, | |
| 81 | - 0x006F980E, 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, | |
| 82 | - 0x00730008, 0x00734019, 0x0073B401, 0x0073C803, 0x00770027, | |
| 48 | + 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163403, | |
| 49 | + 0x00164437, 0x0017CC02, 0x0018001D, 0x00187802, 0x00192C15, | |
| 50 | + 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, 0x001B9C07, | |
| 51 | + 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, 0x001CC01B, | |
| 52 | + 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, 0x00206C09, | |
| 53 | + 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, 0x00217801, | |
| 54 | + 0x00239020, 0x0024E803, 0x0024F812, 0x00254407, 0x00258804, | |
| 55 | + 0x0025C001, 0x00260403, 0x0026F001, 0x0026F807, 0x00271C02, | |
| 56 | + 0x00272C03, 0x00275C01, 0x00278802, 0x0027C802, 0x0027E802, | |
| 57 | + 0x00280403, 0x0028F001, 0x0028F805, 0x00291C02, 0x00292C03, | |
| 58 | + 0x00294401, 0x0029C002, 0x0029D401, 0x002A0403, 0x002AF001, | |
| 59 | + 0x002AF808, 0x002B1C03, 0x002B2C03, 0x002B8802, 0x002BC002, | |
| 60 | + 0x002C0403, 0x002CF001, 0x002CF807, 0x002D1C02, 0x002D2C03, | |
| 61 | + 0x002D5802, 0x002D8802, 0x002DC001, 0x002E0801, 0x002EF805, | |
| 62 | + 0x002F1803, 0x002F2804, 0x002F5C01, 0x002FCC08, 0x00300004, | |
| 63 | + 0x0030F807, 0x00311803, 0x00312804, 0x00315402, 0x00318802, | |
| 64 | + 0x0031FC01, 0x00320403, 0x0032F001, 0x0032F807, 0x00331803, | |
| 65 | + 0x00332804, 0x00335402, 0x00338802, 0x00340403, 0x0034F807, | |
| 66 | + 0x00351803, 0x00352804, 0x00355C01, 0x00358802, 0x0035E401, | |
| 67 | + 0x00360802, 0x00372801, 0x00373C06, 0x00375801, 0x00376008, | |
| 68 | + 0x0037C803, 0x0038C401, 0x0038D007, 0x0038FC01, 0x00391C09, | |
| 69 | + 0x00396802, 0x003AC401, 0x003AD006, 0x003AEC02, 0x003B2006, | |
| 70 | + 0x003C041F, 0x003CD00C, 0x003DC417, 0x003E340B, 0x003E6424, | |
| 71 | + 0x003EF80F, 0x003F380D, 0x0040AC14, 0x00412806, 0x00415804, | |
| 72 | + 0x00417803, 0x00418803, 0x00419C07, 0x0041C404, 0x0042080C, | |
| 73 | + 0x00423C01, 0x00426806, 0x0043EC01, 0x004D740C, 0x004E400A, | |
| 74 | + 0x00500001, 0x0059B402, 0x005A0001, 0x005A6C02, 0x005BAC03, | |
| 75 | + 0x005C4803, 0x005CC805, 0x005D4802, 0x005DC802, 0x005ED023, | |
| 76 | + 0x005F6004, 0x005F7401, 0x0060000F, 0x0062A401, 0x0064800C, | |
| 77 | + 0x0064C00C, 0x00650001, 0x00651002, 0x0066C011, 0x00672002, | |
| 78 | + 0x00677822, 0x00685C05, 0x00687802, 0x0069540A, 0x0069801D, | |
| 79 | + 0x0069FC01, 0x006A8007, 0x006AA006, 0x006AC00F, 0x006C0005, | |
| 80 | + 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, 0x006F980E, | |
| 81 | + 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, 0x00730008, | |
| 82 | + 0x00734019, 0x0073B401, 0x0073C803, 0x0073E002, 0x00770036, | |
| 83 | 83 | 0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403, |
| 84 | - 0x007FB403, 0x007FF402, 0x00800065, 0x0081A806, 0x0081E805, | |
| 85 | - 0x00822805, 0x0082801A, 0x00834021, 0x00840002, 0x00840C04, | |
| 84 | + 0x007FB403, 0x007FF402, 0x00800065, 0x0081980A, 0x0081E805, | |
| 85 | + 0x00822805, 0x0082801E, 0x00834021, 0x00840002, 0x00840C04, | |
| 86 | 86 | 0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401, |
| 87 | 87 | 0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005, |
| 88 | - 0x00852804, 0x00853C01, 0x00864264, 0x00900027, 0x0091000B, | |
| 89 | - 0x0092704E, 0x00940200, 0x009C0475, 0x009E53B9, 0x00AD400A, | |
| 90 | - 0x00B39406, 0x00B3BC03, 0x00B3E404, 0x00B3F802, 0x00B5C001, | |
| 91 | - 0x00B5FC01, 0x00B7804F, 0x00B8C00C, 0x00BA001A, 0x00BA6C59, | |
| 92 | - 0x00BC00D6, 0x00BFC00C, 0x00C00005, 0x00C02019, 0x00C0A807, | |
| 93 | - 0x00C0D802, 0x00C0F403, 0x00C26404, 0x00C28001, 0x00C3EC01, | |
| 94 | - 0x00C64002, 0x00C6580A, 0x00C70024, 0x00C8001F, 0x00C8A81E, | |
| 95 | - 0x00C94001, 0x00C98020, 0x00CA2827, 0x00CB003F, 0x00CC0100, | |
| 96 | - 0x01370040, 0x02924037, 0x0293F802, 0x02983403, 0x0299BC10, | |
| 97 | - 0x029A7C01, 0x029BC008, 0x029C0017, 0x029C8002, 0x029E2402, | |
| 98 | - 0x02A00801, 0x02A01801, 0x02A02C01, 0x02A08C09, 0x02A0D804, | |
| 99 | - 0x02A1D004, 0x02A20002, 0x02A2D011, 0x02A33802, 0x02A38012, | |
| 100 | - 0x02A3E003, 0x02A4980A, 0x02A51C0D, 0x02A57C01, 0x02A60004, | |
| 101 | - 0x02A6CC1B, 0x02A77802, 0x02A8A40E, 0x02A90C01, 0x02A93002, | |
| 102 | - 0x02A97004, 0x02A9DC03, 0x02A9EC01, 0x02AAC001, 0x02AAC803, | |
| 103 | - 0x02AADC02, 0x02AAF802, 0x02AB0401, 0x02AB7802, 0x02ABAC07, | |
| 104 | - 0x02ABD402, 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, | |
| 105 | - 0x037FFC02, 0x03E3FC01, 0x03EC7801, 0x03ECA401, 0x03EEC810, | |
| 106 | - 0x03F4F802, 0x03F7F002, 0x03F8001A, 0x03F88007, 0x03F8C023, | |
| 107 | - 0x03F95013, 0x03F9A004, 0x03FBFC01, 0x03FC040F, 0x03FC6807, | |
| 108 | - 0x03FCEC06, 0x03FD6C0B, 0x03FF8007, 0x03FFA007, 0x03FFE405, | |
| 109 | - 0x04040003, 0x0404DC09, 0x0405E411, 0x0406400C, 0x0407402E, | |
| 110 | - 0x040E7C01, 0x040F4001, 0x04215C01, 0x04247C01, 0x0424FC01, | |
| 111 | - 0x04280403, 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, | |
| 112 | - 0x04294009, 0x0429FC01, 0x042CE407, 0x04400003, 0x0440E016, | |
| 113 | - 0x04420003, 0x0442C012, 0x04440003, 0x04449C0E, 0x04450004, | |
| 114 | - 0x04460003, 0x0446CC0E, 0x04471404, 0x045AAC0D, 0x0491C004, | |
| 115 | - 0x05BD442E, 0x05BE3C04, 0x074000F6, 0x07440027, 0x0744A4B5, | |
| 116 | - 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, 0x075BEC01, | |
| 117 | - 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, 0x075E2401, | |
| 118 | - 0x075EA401, 0x075F0C01, 0x07BBC002, 0x07C0002C, 0x07C0C064, | |
| 119 | - 0x07C2800F, 0x07C2C40E, 0x07C3040F, 0x07C3440F, 0x07C4401F, | |
| 120 | - 0x07C4C03C, 0x07C5C02B, 0x07C7981D, 0x07C8402B, 0x07C90009, | |
| 121 | - 0x07C94002, 0x07CC0021, 0x07CCC006, 0x07CCDC46, 0x07CE0014, | |
| 122 | - 0x07CE8025, 0x07CF1805, 0x07CF8011, 0x07D0003F, 0x07D10001, | |
| 123 | - 0x07D108B6, 0x07D3E404, 0x07D4003E, 0x07D50004, 0x07D54018, | |
| 124 | - 0x07D7EC46, 0x07D9140B, 0x07DA0046, 0x07DC0074, 0x38000401, | |
| 125 | - 0x38008060, 0x380400F0, 0x3C000001, 0x3FFFF401, 0x40000001, | |
| 126 | - 0x43FFF401, | |
| 88 | + 0x00852804, 0x00853C01, 0x0086426B, 0x00900027, 0x0091000B, | |
| 89 | + 0x0092704E, 0x00940276, 0x009E53E0, 0x00ADD820, 0x00AE6022, | |
| 90 | + 0x00AEF40C, 0x00AF2808, 0x00B39406, 0x00B3BC03, 0x00B3E404, | |
| 91 | + 0x00B3F802, 0x00B5C001, 0x00B5FC01, 0x00B7804F, 0x00B8C013, | |
| 92 | + 0x00BA001A, 0x00BA6C59, 0x00BC00D6, 0x00BFC00C, 0x00C00005, | |
| 93 | + 0x00C02019, 0x00C0A807, 0x00C0D802, 0x00C0F403, 0x00C26404, | |
| 94 | + 0x00C28001, 0x00C3EC01, 0x00C64002, 0x00C6580A, 0x00C70024, | |
| 95 | + 0x00C8001F, 0x00C8A81E, 0x00C94001, 0x00C98020, 0x00CA2827, | |
| 96 | + 0x00CB003F, 0x00CC0100, 0x01370040, 0x02924037, 0x0293F802, | |
| 97 | + 0x02983403, 0x0299BC10, 0x029A7C01, 0x029BC008, 0x029C0017, | |
| 98 | + 0x029C8002, 0x029E2402, 0x02A00801, 0x02A01801, 0x02A02C01, | |
| 99 | + 0x02A08C09, 0x02A0D804, 0x02A1D004, 0x02A20002, 0x02A2D011, | |
| 100 | + 0x02A33802, 0x02A38012, 0x02A3E003, 0x02A4980A, 0x02A51C0D, | |
| 101 | + 0x02A57C01, 0x02A60004, 0x02A6CC1B, 0x02A77802, 0x02A79401, | |
| 102 | + 0x02A8A40E, 0x02A90C01, 0x02A93002, 0x02A97004, 0x02A9DC03, | |
| 103 | + 0x02A9EC03, 0x02AAC001, 0x02AAC803, 0x02AADC02, 0x02AAF802, | |
| 104 | + 0x02AB0401, 0x02AB7802, 0x02ABAC07, 0x02ABD402, 0x02AD6C01, | |
| 105 | + 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, 0x037FFC01, | |
| 106 | + 0x03EC7801, 0x03ECA401, 0x03EEC810, 0x03F4F802, 0x03F7F002, | |
| 107 | + 0x03F8001A, 0x03F8800E, 0x03F8C023, 0x03F95013, 0x03F9A004, | |
| 108 | + 0x03FBFC01, 0x03FC040F, 0x03FC6807, 0x03FCEC06, 0x03FD6C0B, | |
| 109 | + 0x03FF8007, 0x03FFA007, 0x03FFE405, 0x04040003, 0x0404DC09, | |
| 110 | + 0x0405E411, 0x04063001, 0x0406400C, 0x04068001, 0x0407402E, | |
| 111 | + 0x040B8001, 0x040DD805, 0x040E7C01, 0x040F4001, 0x0415BC01, | |
| 112 | + 0x04215C01, 0x0421DC02, 0x04247C01, 0x0424FC01, 0x04280403, | |
| 113 | + 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, 0x04294009, | |
| 114 | + 0x0429FC01, 0x042B2001, 0x042B9402, 0x042BC007, 0x042CE407, | |
| 115 | + 0x042E6404, 0x04400003, 0x0440E016, 0x0441FC04, 0x0442C012, | |
| 116 | + 0x04440003, 0x04449C0E, 0x04450004, 0x0445CC03, 0x04460003, | |
| 117 | + 0x0446CC0E, 0x04471404, 0x04473401, 0x0448B012, 0x044B7C0C, | |
| 118 | + 0x044C0403, 0x044CF001, 0x044CF807, 0x044D1C02, 0x044D2C03, | |
| 119 | + 0x044D5C01, 0x044D8802, 0x044D9807, 0x044DC005, 0x0452C014, | |
| 120 | + 0x04531801, 0x0456BC07, 0x0456E012, 0x0458C014, 0x045AAC0D, | |
| 121 | + 0x0491C005, 0x05A9B802, 0x05ABC006, 0x05ACC010, 0x05AD1002, | |
| 122 | + 0x05BD442E, 0x05BE3C04, 0x06F27008, 0x074000F6, 0x07440027, | |
| 123 | + 0x0744A4B5, 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, | |
| 124 | + 0x075BEC01, 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, | |
| 125 | + 0x075E2401, 0x075EA401, 0x075F0C01, 0x07A34007, 0x07BBC002, | |
| 126 | + 0x07C0002C, 0x07C0C064, 0x07C2800F, 0x07C2C40F, 0x07C3040F, | |
| 127 | + 0x07C34425, 0x07C4401F, 0x07C4C03C, 0x07C5C02B, 0x07C7981D, | |
| 128 | + 0x07C8402B, 0x07C90009, 0x07C94002, 0x07CC002D, 0x07CCC04E, | |
| 129 | + 0x07CE004F, 0x07CF5024, 0x07D000FF, 0x07D4004B, 0x07D5402A, | |
| 130 | + 0x07D5EC29, 0x07D6949E, 0x07D9148B, 0x07DB800D, 0x07DBC004, | |
| 131 | + 0x07DC0074, 0x07DE0055, 0x07E0000C, 0x07E04038, 0x07E1400A, | |
| 132 | + 0x07E18028, 0x07E2401E, 0x38000401, 0x38008060, 0x380400F0, | |
| 127 | 133 | }; |
| 128 | 134 | static const unsigned int aAscii[4] = { |
| 129 | 135 | 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001, |
| 130 | 136 | }; |
| 131 | 137 | |
| @@ -160,35 +166,35 @@ | ||
| 160 | 166 | ** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER |
| 161 | 167 | ** E"). The resuls of passing a codepoint that corresponds to an |
| 162 | 168 | ** uppercase letter are undefined. |
| 163 | 169 | */ |
| 164 | 170 | static int unicode_remove_diacritic(int c){ |
| 165 | - unsigned short aDia[] = { | |
| 166 | - 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, | |
| 167 | - 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, | |
| 168 | - 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, | |
| 169 | - 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, | |
| 170 | - 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, | |
| 171 | - 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, | |
| 172 | - 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, | |
| 173 | - 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, | |
| 174 | - 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, | |
| 175 | - 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, | |
| 176 | - 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, | |
| 177 | - 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, | |
| 178 | - 62924, 63050, 63082, 63274, 63390, | |
| 171 | + static const unsigned short aDia[] = { | |
| 172 | + 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, | |
| 173 | + 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, | |
| 174 | + 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, | |
| 175 | + 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, | |
| 176 | + 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, | |
| 177 | + 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, | |
| 178 | + 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, | |
| 179 | + 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, | |
| 180 | + 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, | |
| 181 | + 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, | |
| 182 | + 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, | |
| 183 | + 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, | |
| 184 | + 62924, 63050, 63082, 63274, 63390, | |
| 179 | 185 | }; |
| 180 | - char aChar[] = { | |
| 181 | - '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', | |
| 182 | - 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', | |
| 183 | - 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', | |
| 184 | - 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', | |
| 185 | - 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', | |
| 186 | - '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', | |
| 187 | - 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', | |
| 188 | - 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', | |
| 189 | - 'e', 'i', 'o', 'u', 'y', | |
| 186 | + static const char aChar[] = { | |
| 187 | + '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', | |
| 188 | + 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', | |
| 189 | + 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', | |
| 190 | + 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', | |
| 191 | + 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', | |
| 192 | + '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', | |
| 193 | + 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', | |
| 194 | + 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', | |
| 195 | + 'e', 'i', 'o', 'u', 'y', | |
| 190 | 196 | }; |
| 191 | 197 | |
| 192 | 198 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 193 | 199 | int iRes = 0; |
| 194 | 200 | int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; |
| @@ -253,12 +259,12 @@ | ||
| 253 | 259 | unsigned char flags; |
| 254 | 260 | unsigned char nRange; |
| 255 | 261 | } aEntry[] = { |
| 256 | 262 | {65, 14, 26}, {181, 64, 1}, {192, 14, 23}, |
| 257 | 263 | {216, 14, 7}, {256, 1, 48}, {306, 1, 6}, |
| 258 | - {313, 1, 16}, {330, 1, 46}, {376, 116, 1}, | |
| 259 | - {377, 1, 6}, {383, 104, 1}, {385, 50, 1}, | |
| 264 | + {313, 1, 16}, {330, 1, 46}, {376, 126, 1}, | |
| 265 | + {377, 1, 6}, {383, 114, 1}, {385, 50, 1}, | |
| 260 | 266 | {386, 1, 4}, {390, 44, 1}, {391, 0, 1}, |
| 261 | 267 | {393, 42, 2}, {395, 0, 1}, {398, 32, 1}, |
| 262 | 268 | {399, 38, 1}, {400, 40, 1}, {401, 0, 1}, |
| 263 | 269 | {403, 42, 1}, {404, 46, 1}, {406, 52, 1}, |
| 264 | 270 | {407, 48, 1}, {408, 0, 1}, {412, 52, 1}, |
| @@ -267,61 +273,64 @@ | ||
| 267 | 273 | {428, 0, 1}, {430, 60, 1}, {431, 0, 1}, |
| 268 | 274 | {433, 58, 2}, {435, 1, 4}, {439, 62, 1}, |
| 269 | 275 | {440, 0, 1}, {444, 0, 1}, {452, 2, 1}, |
| 270 | 276 | {453, 0, 1}, {455, 2, 1}, {456, 0, 1}, |
| 271 | 277 | {458, 2, 1}, {459, 1, 18}, {478, 1, 18}, |
| 272 | - {497, 2, 1}, {498, 1, 4}, {502, 122, 1}, | |
| 273 | - {503, 134, 1}, {504, 1, 40}, {544, 110, 1}, | |
| 278 | + {497, 2, 1}, {498, 1, 4}, {502, 132, 1}, | |
| 279 | + {503, 144, 1}, {504, 1, 40}, {544, 120, 1}, | |
| 274 | 280 | {546, 1, 18}, {570, 70, 1}, {571, 0, 1}, |
| 275 | - {573, 108, 1}, {574, 68, 1}, {577, 0, 1}, | |
| 276 | - {579, 106, 1}, {580, 28, 1}, {581, 30, 1}, | |
| 281 | + {573, 118, 1}, {574, 68, 1}, {577, 0, 1}, | |
| 282 | + {579, 116, 1}, {580, 28, 1}, {581, 30, 1}, | |
| 277 | 283 | {582, 1, 10}, {837, 36, 1}, {880, 1, 4}, |
| 278 | - {886, 0, 1}, {902, 18, 1}, {904, 16, 3}, | |
| 279 | - {908, 26, 1}, {910, 24, 2}, {913, 14, 17}, | |
| 280 | - {931, 14, 9}, {962, 0, 1}, {975, 4, 1}, | |
| 281 | - {976, 140, 1}, {977, 142, 1}, {981, 146, 1}, | |
| 282 | - {982, 144, 1}, {984, 1, 24}, {1008, 136, 1}, | |
| 283 | - {1009, 138, 1}, {1012, 130, 1}, {1013, 128, 1}, | |
| 284 | - {1015, 0, 1}, {1017, 152, 1}, {1018, 0, 1}, | |
| 285 | - {1021, 110, 3}, {1024, 34, 16}, {1040, 14, 32}, | |
| 286 | - {1120, 1, 34}, {1162, 1, 54}, {1216, 6, 1}, | |
| 287 | - {1217, 1, 14}, {1232, 1, 88}, {1329, 22, 38}, | |
| 288 | - {4256, 66, 38}, {4295, 66, 1}, {4301, 66, 1}, | |
| 289 | - {7680, 1, 150}, {7835, 132, 1}, {7838, 96, 1}, | |
| 290 | - {7840, 1, 96}, {7944, 150, 8}, {7960, 150, 6}, | |
| 291 | - {7976, 150, 8}, {7992, 150, 8}, {8008, 150, 6}, | |
| 292 | - {8025, 151, 8}, {8040, 150, 8}, {8072, 150, 8}, | |
| 293 | - {8088, 150, 8}, {8104, 150, 8}, {8120, 150, 2}, | |
| 294 | - {8122, 126, 2}, {8124, 148, 1}, {8126, 100, 1}, | |
| 295 | - {8136, 124, 4}, {8140, 148, 1}, {8152, 150, 2}, | |
| 296 | - {8154, 120, 2}, {8168, 150, 2}, {8170, 118, 2}, | |
| 297 | - {8172, 152, 1}, {8184, 112, 2}, {8186, 114, 2}, | |
| 298 | - {8188, 148, 1}, {8486, 98, 1}, {8490, 92, 1}, | |
| 299 | - {8491, 94, 1}, {8498, 12, 1}, {8544, 8, 16}, | |
| 300 | - {8579, 0, 1}, {9398, 10, 26}, {11264, 22, 47}, | |
| 301 | - {11360, 0, 1}, {11362, 88, 1}, {11363, 102, 1}, | |
| 302 | - {11364, 90, 1}, {11367, 1, 6}, {11373, 84, 1}, | |
| 303 | - {11374, 86, 1}, {11375, 80, 1}, {11376, 82, 1}, | |
| 304 | - {11378, 0, 1}, {11381, 0, 1}, {11390, 78, 2}, | |
| 305 | - {11392, 1, 100}, {11499, 1, 4}, {11506, 0, 1}, | |
| 306 | - {42560, 1, 46}, {42624, 1, 24}, {42786, 1, 14}, | |
| 307 | - {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, | |
| 308 | - {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, | |
| 309 | - {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, | |
| 310 | - {65313, 14, 26}, | |
| 284 | + {886, 0, 1}, {895, 36, 1}, {902, 18, 1}, | |
| 285 | + {904, 16, 3}, {908, 26, 1}, {910, 24, 2}, | |
| 286 | + {913, 14, 17}, {931, 14, 9}, {962, 0, 1}, | |
| 287 | + {975, 4, 1}, {976, 150, 1}, {977, 152, 1}, | |
| 288 | + {981, 156, 1}, {982, 154, 1}, {984, 1, 24}, | |
| 289 | + {1008, 146, 1}, {1009, 148, 1}, {1012, 140, 1}, | |
| 290 | + {1013, 138, 1}, {1015, 0, 1}, {1017, 162, 1}, | |
| 291 | + {1018, 0, 1}, {1021, 120, 3}, {1024, 34, 16}, | |
| 292 | + {1040, 14, 32}, {1120, 1, 34}, {1162, 1, 54}, | |
| 293 | + {1216, 6, 1}, {1217, 1, 14}, {1232, 1, 96}, | |
| 294 | + {1329, 22, 38}, {4256, 66, 38}, {4295, 66, 1}, | |
| 295 | + {4301, 66, 1}, {7680, 1, 150}, {7835, 142, 1}, | |
| 296 | + {7838, 106, 1}, {7840, 1, 96}, {7944, 160, 8}, | |
| 297 | + {7960, 160, 6}, {7976, 160, 8}, {7992, 160, 8}, | |
| 298 | + {8008, 160, 6}, {8025, 161, 8}, {8040, 160, 8}, | |
| 299 | + {8072, 160, 8}, {8088, 160, 8}, {8104, 160, 8}, | |
| 300 | + {8120, 160, 2}, {8122, 136, 2}, {8124, 158, 1}, | |
| 301 | + {8126, 110, 1}, {8136, 134, 4}, {8140, 158, 1}, | |
| 302 | + {8152, 160, 2}, {8154, 130, 2}, {8168, 160, 2}, | |
| 303 | + {8170, 128, 2}, {8172, 162, 1}, {8184, 122, 2}, | |
| 304 | + {8186, 124, 2}, {8188, 158, 1}, {8486, 108, 1}, | |
| 305 | + {8490, 102, 1}, {8491, 104, 1}, {8498, 12, 1}, | |
| 306 | + {8544, 8, 16}, {8579, 0, 1}, {9398, 10, 26}, | |
| 307 | + {11264, 22, 47}, {11360, 0, 1}, {11362, 98, 1}, | |
| 308 | + {11363, 112, 1}, {11364, 100, 1}, {11367, 1, 6}, | |
| 309 | + {11373, 94, 1}, {11374, 96, 1}, {11375, 90, 1}, | |
| 310 | + {11376, 92, 1}, {11378, 0, 1}, {11381, 0, 1}, | |
| 311 | + {11390, 88, 2}, {11392, 1, 100}, {11499, 1, 4}, | |
| 312 | + {11506, 0, 1}, {42560, 1, 46}, {42624, 1, 28}, | |
| 313 | + {42786, 1, 14}, {42802, 1, 62}, {42873, 1, 4}, | |
| 314 | + {42877, 86, 1}, {42878, 1, 10}, {42891, 0, 1}, | |
| 315 | + {42893, 82, 1}, {42896, 1, 4}, {42902, 1, 20}, | |
| 316 | + {42922, 76, 1}, {42923, 72, 1}, {42924, 74, 1}, | |
| 317 | + {42925, 78, 1}, {42928, 84, 1}, {42929, 80, 1}, | |
| 318 | + {65313, 14, 26}, | |
| 311 | 319 | }; |
| 312 | 320 | static const unsigned short aiOff[] = { |
| 313 | - 1, 2, 8, 15, 16, 26, 28, 32, | |
| 314 | - 37, 38, 40, 48, 63, 64, 69, 71, | |
| 315 | - 79, 80, 116, 202, 203, 205, 206, 207, | |
| 316 | - 209, 210, 211, 213, 214, 217, 218, 219, | |
| 317 | - 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, | |
| 318 | - 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, | |
| 319 | - 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, | |
| 320 | - 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, | |
| 321 | - 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, | |
| 322 | - 65514, 65521, 65527, 65528, 65529, | |
| 321 | + 1, 2, 8, 15, 16, 26, 28, 32, | |
| 322 | + 37, 38, 40, 48, 63, 64, 69, 71, | |
| 323 | + 79, 80, 116, 202, 203, 205, 206, 207, | |
| 324 | + 209, 210, 211, 213, 214, 217, 218, 219, | |
| 325 | + 775, 7264, 10792, 10795, 23217, 23221, 23228, 23231, | |
| 326 | + 23254, 23256, 23278, 30204, 54721, 54753, 54754, 54756, | |
| 327 | + 54787, 54793, 54809, 57153, 57274, 57921, 58019, 58363, | |
| 328 | + 61722, 65268, 65341, 65373, 65406, 65408, 65410, 65415, | |
| 329 | + 65424, 65436, 65439, 65450, 65462, 65472, 65476, 65478, | |
| 330 | + 65480, 65482, 65488, 65506, 65511, 65514, 65521, 65527, | |
| 331 | + 65528, 65529, | |
| 323 | 332 | }; |
| 324 | 333 | |
| 325 | 334 | int ret = c; |
| 326 | 335 | |
| 327 | 336 | assert( c>=0 ); |
| @@ -354,12 +363,15 @@ | ||
| 354 | 363 | } |
| 355 | 364 | } |
| 356 | 365 | |
| 357 | 366 | if( bRemoveDiacritic ) ret = unicode_remove_diacritic(ret); |
| 358 | 367 | } |
| 359 | - | |
| 368 | + | |
| 360 | 369 | else if( c>=66560 && c<66600 ){ |
| 361 | 370 | ret = c + 40; |
| 371 | + } | |
| 372 | + else if( c>=71840 && c<71872 ){ | |
| 373 | + ret = c + 32; | |
| 362 | 374 | } |
| 363 | 375 | |
| 364 | 376 | return ret; |
| 365 | 377 | } |
| 366 | 378 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -31,101 +31,107 @@ | |
| 31 | int unicode_isalnum(int c){ |
| 32 | /* Each unsigned integer in the following array corresponds to a contiguous |
| 33 | ** range of unicode codepoints that are not either letters or numbers (i.e. |
| 34 | ** codepoints for which this function should return 0). |
| 35 | ** |
| 36 | ** The most significant 22 bits in each 32-bit value contain the first |
| 37 | ** codepoint in the range. The least significant 10 bits are used to store |
| 38 | ** the size of the range (always at least 1). In other words, the value |
| 39 | ** ((C<<22) + N) represents a range of N codepoints starting with codepoint |
| 40 | ** C. It is not possible to represent a range larger than 1023 codepoints |
| 41 | ** using this format. |
| 42 | */ |
| 43 | static const unsigned int aEntry[] = { |
| 44 | 0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07, |
| 45 | 0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01, |
| 46 | 0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401, |
| 47 | 0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01, |
| 48 | 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163C01, |
| 49 | 0x00164437, 0x0017CC02, 0x00180005, 0x00181816, 0x00187802, |
| 50 | 0x00192C15, 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, |
| 51 | 0x001B9C07, 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, |
| 52 | 0x001CC01B, 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, |
| 53 | 0x00206C09, 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, |
| 54 | 0x00217801, 0x0023901B, 0x00240004, 0x0024E803, 0x0024F812, |
| 55 | 0x00254407, 0x00258804, 0x0025C001, 0x00260403, 0x0026F001, |
| 56 | 0x0026F807, 0x00271C02, 0x00272C03, 0x00275C01, 0x00278802, |
| 57 | 0x0027C802, 0x0027E802, 0x00280403, 0x0028F001, 0x0028F805, |
| 58 | 0x00291C02, 0x00292C03, 0x00294401, 0x0029C002, 0x0029D401, |
| 59 | 0x002A0403, 0x002AF001, 0x002AF808, 0x002B1C03, 0x002B2C03, |
| 60 | 0x002B8802, 0x002BC002, 0x002C0403, 0x002CF001, 0x002CF807, |
| 61 | 0x002D1C02, 0x002D2C03, 0x002D5802, 0x002D8802, 0x002DC001, |
| 62 | 0x002E0801, 0x002EF805, 0x002F1803, 0x002F2804, 0x002F5C01, |
| 63 | 0x002FCC08, 0x00300403, 0x0030F807, 0x00311803, 0x00312804, |
| 64 | 0x00315402, 0x00318802, 0x0031FC01, 0x00320802, 0x0032F001, |
| 65 | 0x0032F807, 0x00331803, 0x00332804, 0x00335402, 0x00338802, |
| 66 | 0x00340802, 0x0034F807, 0x00351803, 0x00352804, 0x00355C01, |
| 67 | 0x00358802, 0x0035E401, 0x00360802, 0x00372801, 0x00373C06, |
| 68 | 0x00375801, 0x00376008, 0x0037C803, 0x0038C401, 0x0038D007, |
| 69 | 0x0038FC01, 0x00391C09, 0x00396802, 0x003AC401, 0x003AD006, |
| 70 | 0x003AEC02, 0x003B2006, 0x003C041F, 0x003CD00C, 0x003DC417, |
| 71 | 0x003E340B, 0x003E6424, 0x003EF80F, 0x003F380D, 0x0040AC14, |
| 72 | 0x00412806, 0x00415804, 0x00417803, 0x00418803, 0x00419C07, |
| 73 | 0x0041C404, 0x0042080C, 0x00423C01, 0x00426806, 0x0043EC01, |
| 74 | 0x004D740C, 0x004E400A, 0x00500001, 0x0059B402, 0x005A0001, |
| 75 | 0x005A6C02, 0x005BAC03, 0x005C4803, 0x005CC805, 0x005D4802, |
| 76 | 0x005DC802, 0x005ED023, 0x005F6004, 0x005F7401, 0x0060000F, |
| 77 | 0x0062A401, 0x0064800C, 0x0064C00C, 0x00650001, 0x00651002, |
| 78 | 0x0066C011, 0x00672002, 0x00677822, 0x00685C05, 0x00687802, |
| 79 | 0x0069540A, 0x0069801D, 0x0069FC01, 0x006A8007, 0x006AA006, |
| 80 | 0x006C0005, 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, |
| 81 | 0x006F980E, 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, |
| 82 | 0x00730008, 0x00734019, 0x0073B401, 0x0073C803, 0x00770027, |
| 83 | 0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403, |
| 84 | 0x007FB403, 0x007FF402, 0x00800065, 0x0081A806, 0x0081E805, |
| 85 | 0x00822805, 0x0082801A, 0x00834021, 0x00840002, 0x00840C04, |
| 86 | 0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401, |
| 87 | 0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005, |
| 88 | 0x00852804, 0x00853C01, 0x00864264, 0x00900027, 0x0091000B, |
| 89 | 0x0092704E, 0x00940200, 0x009C0475, 0x009E53B9, 0x00AD400A, |
| 90 | 0x00B39406, 0x00B3BC03, 0x00B3E404, 0x00B3F802, 0x00B5C001, |
| 91 | 0x00B5FC01, 0x00B7804F, 0x00B8C00C, 0x00BA001A, 0x00BA6C59, |
| 92 | 0x00BC00D6, 0x00BFC00C, 0x00C00005, 0x00C02019, 0x00C0A807, |
| 93 | 0x00C0D802, 0x00C0F403, 0x00C26404, 0x00C28001, 0x00C3EC01, |
| 94 | 0x00C64002, 0x00C6580A, 0x00C70024, 0x00C8001F, 0x00C8A81E, |
| 95 | 0x00C94001, 0x00C98020, 0x00CA2827, 0x00CB003F, 0x00CC0100, |
| 96 | 0x01370040, 0x02924037, 0x0293F802, 0x02983403, 0x0299BC10, |
| 97 | 0x029A7C01, 0x029BC008, 0x029C0017, 0x029C8002, 0x029E2402, |
| 98 | 0x02A00801, 0x02A01801, 0x02A02C01, 0x02A08C09, 0x02A0D804, |
| 99 | 0x02A1D004, 0x02A20002, 0x02A2D011, 0x02A33802, 0x02A38012, |
| 100 | 0x02A3E003, 0x02A4980A, 0x02A51C0D, 0x02A57C01, 0x02A60004, |
| 101 | 0x02A6CC1B, 0x02A77802, 0x02A8A40E, 0x02A90C01, 0x02A93002, |
| 102 | 0x02A97004, 0x02A9DC03, 0x02A9EC01, 0x02AAC001, 0x02AAC803, |
| 103 | 0x02AADC02, 0x02AAF802, 0x02AB0401, 0x02AB7802, 0x02ABAC07, |
| 104 | 0x02ABD402, 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, |
| 105 | 0x037FFC02, 0x03E3FC01, 0x03EC7801, 0x03ECA401, 0x03EEC810, |
| 106 | 0x03F4F802, 0x03F7F002, 0x03F8001A, 0x03F88007, 0x03F8C023, |
| 107 | 0x03F95013, 0x03F9A004, 0x03FBFC01, 0x03FC040F, 0x03FC6807, |
| 108 | 0x03FCEC06, 0x03FD6C0B, 0x03FF8007, 0x03FFA007, 0x03FFE405, |
| 109 | 0x04040003, 0x0404DC09, 0x0405E411, 0x0406400C, 0x0407402E, |
| 110 | 0x040E7C01, 0x040F4001, 0x04215C01, 0x04247C01, 0x0424FC01, |
| 111 | 0x04280403, 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, |
| 112 | 0x04294009, 0x0429FC01, 0x042CE407, 0x04400003, 0x0440E016, |
| 113 | 0x04420003, 0x0442C012, 0x04440003, 0x04449C0E, 0x04450004, |
| 114 | 0x04460003, 0x0446CC0E, 0x04471404, 0x045AAC0D, 0x0491C004, |
| 115 | 0x05BD442E, 0x05BE3C04, 0x074000F6, 0x07440027, 0x0744A4B5, |
| 116 | 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, 0x075BEC01, |
| 117 | 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, 0x075E2401, |
| 118 | 0x075EA401, 0x075F0C01, 0x07BBC002, 0x07C0002C, 0x07C0C064, |
| 119 | 0x07C2800F, 0x07C2C40E, 0x07C3040F, 0x07C3440F, 0x07C4401F, |
| 120 | 0x07C4C03C, 0x07C5C02B, 0x07C7981D, 0x07C8402B, 0x07C90009, |
| 121 | 0x07C94002, 0x07CC0021, 0x07CCC006, 0x07CCDC46, 0x07CE0014, |
| 122 | 0x07CE8025, 0x07CF1805, 0x07CF8011, 0x07D0003F, 0x07D10001, |
| 123 | 0x07D108B6, 0x07D3E404, 0x07D4003E, 0x07D50004, 0x07D54018, |
| 124 | 0x07D7EC46, 0x07D9140B, 0x07DA0046, 0x07DC0074, 0x38000401, |
| 125 | 0x38008060, 0x380400F0, 0x3C000001, 0x3FFFF401, 0x40000001, |
| 126 | 0x43FFF401, |
| 127 | }; |
| 128 | static const unsigned int aAscii[4] = { |
| 129 | 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001, |
| 130 | }; |
| 131 | |
| @@ -160,35 +166,35 @@ | |
| 160 | ** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER |
| 161 | ** E"). The resuls of passing a codepoint that corresponds to an |
| 162 | ** uppercase letter are undefined. |
| 163 | */ |
| 164 | static int unicode_remove_diacritic(int c){ |
| 165 | unsigned short aDia[] = { |
| 166 | 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, |
| 167 | 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, |
| 168 | 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, |
| 169 | 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, |
| 170 | 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, |
| 171 | 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, |
| 172 | 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, |
| 173 | 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, |
| 174 | 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, |
| 175 | 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, |
| 176 | 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, |
| 177 | 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, |
| 178 | 62924, 63050, 63082, 63274, 63390, |
| 179 | }; |
| 180 | char aChar[] = { |
| 181 | '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', |
| 182 | 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', |
| 183 | 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', |
| 184 | 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', |
| 185 | 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', |
| 186 | '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', |
| 187 | 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', |
| 188 | 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', |
| 189 | 'e', 'i', 'o', 'u', 'y', |
| 190 | }; |
| 191 | |
| 192 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 193 | int iRes = 0; |
| 194 | int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; |
| @@ -253,12 +259,12 @@ | |
| 253 | unsigned char flags; |
| 254 | unsigned char nRange; |
| 255 | } aEntry[] = { |
| 256 | {65, 14, 26}, {181, 64, 1}, {192, 14, 23}, |
| 257 | {216, 14, 7}, {256, 1, 48}, {306, 1, 6}, |
| 258 | {313, 1, 16}, {330, 1, 46}, {376, 116, 1}, |
| 259 | {377, 1, 6}, {383, 104, 1}, {385, 50, 1}, |
| 260 | {386, 1, 4}, {390, 44, 1}, {391, 0, 1}, |
| 261 | {393, 42, 2}, {395, 0, 1}, {398, 32, 1}, |
| 262 | {399, 38, 1}, {400, 40, 1}, {401, 0, 1}, |
| 263 | {403, 42, 1}, {404, 46, 1}, {406, 52, 1}, |
| 264 | {407, 48, 1}, {408, 0, 1}, {412, 52, 1}, |
| @@ -267,61 +273,64 @@ | |
| 267 | {428, 0, 1}, {430, 60, 1}, {431, 0, 1}, |
| 268 | {433, 58, 2}, {435, 1, 4}, {439, 62, 1}, |
| 269 | {440, 0, 1}, {444, 0, 1}, {452, 2, 1}, |
| 270 | {453, 0, 1}, {455, 2, 1}, {456, 0, 1}, |
| 271 | {458, 2, 1}, {459, 1, 18}, {478, 1, 18}, |
| 272 | {497, 2, 1}, {498, 1, 4}, {502, 122, 1}, |
| 273 | {503, 134, 1}, {504, 1, 40}, {544, 110, 1}, |
| 274 | {546, 1, 18}, {570, 70, 1}, {571, 0, 1}, |
| 275 | {573, 108, 1}, {574, 68, 1}, {577, 0, 1}, |
| 276 | {579, 106, 1}, {580, 28, 1}, {581, 30, 1}, |
| 277 | {582, 1, 10}, {837, 36, 1}, {880, 1, 4}, |
| 278 | {886, 0, 1}, {902, 18, 1}, {904, 16, 3}, |
| 279 | {908, 26, 1}, {910, 24, 2}, {913, 14, 17}, |
| 280 | {931, 14, 9}, {962, 0, 1}, {975, 4, 1}, |
| 281 | {976, 140, 1}, {977, 142, 1}, {981, 146, 1}, |
| 282 | {982, 144, 1}, {984, 1, 24}, {1008, 136, 1}, |
| 283 | {1009, 138, 1}, {1012, 130, 1}, {1013, 128, 1}, |
| 284 | {1015, 0, 1}, {1017, 152, 1}, {1018, 0, 1}, |
| 285 | {1021, 110, 3}, {1024, 34, 16}, {1040, 14, 32}, |
| 286 | {1120, 1, 34}, {1162, 1, 54}, {1216, 6, 1}, |
| 287 | {1217, 1, 14}, {1232, 1, 88}, {1329, 22, 38}, |
| 288 | {4256, 66, 38}, {4295, 66, 1}, {4301, 66, 1}, |
| 289 | {7680, 1, 150}, {7835, 132, 1}, {7838, 96, 1}, |
| 290 | {7840, 1, 96}, {7944, 150, 8}, {7960, 150, 6}, |
| 291 | {7976, 150, 8}, {7992, 150, 8}, {8008, 150, 6}, |
| 292 | {8025, 151, 8}, {8040, 150, 8}, {8072, 150, 8}, |
| 293 | {8088, 150, 8}, {8104, 150, 8}, {8120, 150, 2}, |
| 294 | {8122, 126, 2}, {8124, 148, 1}, {8126, 100, 1}, |
| 295 | {8136, 124, 4}, {8140, 148, 1}, {8152, 150, 2}, |
| 296 | {8154, 120, 2}, {8168, 150, 2}, {8170, 118, 2}, |
| 297 | {8172, 152, 1}, {8184, 112, 2}, {8186, 114, 2}, |
| 298 | {8188, 148, 1}, {8486, 98, 1}, {8490, 92, 1}, |
| 299 | {8491, 94, 1}, {8498, 12, 1}, {8544, 8, 16}, |
| 300 | {8579, 0, 1}, {9398, 10, 26}, {11264, 22, 47}, |
| 301 | {11360, 0, 1}, {11362, 88, 1}, {11363, 102, 1}, |
| 302 | {11364, 90, 1}, {11367, 1, 6}, {11373, 84, 1}, |
| 303 | {11374, 86, 1}, {11375, 80, 1}, {11376, 82, 1}, |
| 304 | {11378, 0, 1}, {11381, 0, 1}, {11390, 78, 2}, |
| 305 | {11392, 1, 100}, {11499, 1, 4}, {11506, 0, 1}, |
| 306 | {42560, 1, 46}, {42624, 1, 24}, {42786, 1, 14}, |
| 307 | {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, |
| 308 | {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, |
| 309 | {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, |
| 310 | {65313, 14, 26}, |
| 311 | }; |
| 312 | static const unsigned short aiOff[] = { |
| 313 | 1, 2, 8, 15, 16, 26, 28, 32, |
| 314 | 37, 38, 40, 48, 63, 64, 69, 71, |
| 315 | 79, 80, 116, 202, 203, 205, 206, 207, |
| 316 | 209, 210, 211, 213, 214, 217, 218, 219, |
| 317 | 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, |
| 318 | 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, |
| 319 | 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, |
| 320 | 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, |
| 321 | 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, |
| 322 | 65514, 65521, 65527, 65528, 65529, |
| 323 | }; |
| 324 | |
| 325 | int ret = c; |
| 326 | |
| 327 | assert( c>=0 ); |
| @@ -354,12 +363,15 @@ | |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | if( bRemoveDiacritic ) ret = unicode_remove_diacritic(ret); |
| 358 | } |
| 359 | |
| 360 | else if( c>=66560 && c<66600 ){ |
| 361 | ret = c + 40; |
| 362 | } |
| 363 | |
| 364 | return ret; |
| 365 | } |
| 366 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -31,101 +31,107 @@ | |
| 31 | int unicode_isalnum(int c){ |
| 32 | /* Each unsigned integer in the following array corresponds to a contiguous |
| 33 | ** range of unicode codepoints that are not either letters or numbers (i.e. |
| 34 | ** codepoints for which this function should return 0). |
| 35 | ** |
| 36 | ** The most significant 22 bits in each 32-bit value contain the first |
| 37 | ** codepoint in the range. The least significant 10 bits are used to store |
| 38 | ** the size of the range (always at least 1). In other words, the value |
| 39 | ** ((C<<22) + N) represents a range of N codepoints starting with codepoint |
| 40 | ** C. It is not possible to represent a range larger than 1023 codepoints |
| 41 | ** using this format. |
| 42 | */ |
| 43 | static const unsigned int aEntry[] = { |
| 44 | 0x00000030, 0x0000E807, 0x00016C06, 0x0001EC2F, 0x0002AC07, |
| 45 | 0x0002D001, 0x0002D803, 0x0002EC01, 0x0002FC01, 0x00035C01, |
| 46 | 0x0003DC01, 0x000B0804, 0x000B480E, 0x000B9407, 0x000BB401, |
| 47 | 0x000BBC81, 0x000DD401, 0x000DF801, 0x000E1002, 0x000E1C01, |
| 48 | 0x000FD801, 0x00120808, 0x00156806, 0x00162402, 0x00163403, |
| 49 | 0x00164437, 0x0017CC02, 0x0018001D, 0x00187802, 0x00192C15, |
| 50 | 0x0019A804, 0x0019C001, 0x001B5001, 0x001B580F, 0x001B9C07, |
| 51 | 0x001BF402, 0x001C000E, 0x001C3C01, 0x001C4401, 0x001CC01B, |
| 52 | 0x001E980B, 0x001FAC09, 0x001FD804, 0x00205804, 0x00206C09, |
| 53 | 0x00209403, 0x0020A405, 0x0020C00F, 0x00216403, 0x00217801, |
| 54 | 0x00239020, 0x0024E803, 0x0024F812, 0x00254407, 0x00258804, |
| 55 | 0x0025C001, 0x00260403, 0x0026F001, 0x0026F807, 0x00271C02, |
| 56 | 0x00272C03, 0x00275C01, 0x00278802, 0x0027C802, 0x0027E802, |
| 57 | 0x00280403, 0x0028F001, 0x0028F805, 0x00291C02, 0x00292C03, |
| 58 | 0x00294401, 0x0029C002, 0x0029D401, 0x002A0403, 0x002AF001, |
| 59 | 0x002AF808, 0x002B1C03, 0x002B2C03, 0x002B8802, 0x002BC002, |
| 60 | 0x002C0403, 0x002CF001, 0x002CF807, 0x002D1C02, 0x002D2C03, |
| 61 | 0x002D5802, 0x002D8802, 0x002DC001, 0x002E0801, 0x002EF805, |
| 62 | 0x002F1803, 0x002F2804, 0x002F5C01, 0x002FCC08, 0x00300004, |
| 63 | 0x0030F807, 0x00311803, 0x00312804, 0x00315402, 0x00318802, |
| 64 | 0x0031FC01, 0x00320403, 0x0032F001, 0x0032F807, 0x00331803, |
| 65 | 0x00332804, 0x00335402, 0x00338802, 0x00340403, 0x0034F807, |
| 66 | 0x00351803, 0x00352804, 0x00355C01, 0x00358802, 0x0035E401, |
| 67 | 0x00360802, 0x00372801, 0x00373C06, 0x00375801, 0x00376008, |
| 68 | 0x0037C803, 0x0038C401, 0x0038D007, 0x0038FC01, 0x00391C09, |
| 69 | 0x00396802, 0x003AC401, 0x003AD006, 0x003AEC02, 0x003B2006, |
| 70 | 0x003C041F, 0x003CD00C, 0x003DC417, 0x003E340B, 0x003E6424, |
| 71 | 0x003EF80F, 0x003F380D, 0x0040AC14, 0x00412806, 0x00415804, |
| 72 | 0x00417803, 0x00418803, 0x00419C07, 0x0041C404, 0x0042080C, |
| 73 | 0x00423C01, 0x00426806, 0x0043EC01, 0x004D740C, 0x004E400A, |
| 74 | 0x00500001, 0x0059B402, 0x005A0001, 0x005A6C02, 0x005BAC03, |
| 75 | 0x005C4803, 0x005CC805, 0x005D4802, 0x005DC802, 0x005ED023, |
| 76 | 0x005F6004, 0x005F7401, 0x0060000F, 0x0062A401, 0x0064800C, |
| 77 | 0x0064C00C, 0x00650001, 0x00651002, 0x0066C011, 0x00672002, |
| 78 | 0x00677822, 0x00685C05, 0x00687802, 0x0069540A, 0x0069801D, |
| 79 | 0x0069FC01, 0x006A8007, 0x006AA006, 0x006AC00F, 0x006C0005, |
| 80 | 0x006CD011, 0x006D6823, 0x006E0003, 0x006E840D, 0x006F980E, |
| 81 | 0x006FF004, 0x00709014, 0x0070EC05, 0x0071F802, 0x00730008, |
| 82 | 0x00734019, 0x0073B401, 0x0073C803, 0x0073E002, 0x00770036, |
| 83 | 0x0077F004, 0x007EF401, 0x007EFC03, 0x007F3403, 0x007F7403, |
| 84 | 0x007FB403, 0x007FF402, 0x00800065, 0x0081980A, 0x0081E805, |
| 85 | 0x00822805, 0x0082801E, 0x00834021, 0x00840002, 0x00840C04, |
| 86 | 0x00842002, 0x00845001, 0x00845803, 0x00847806, 0x00849401, |
| 87 | 0x00849C01, 0x0084A401, 0x0084B801, 0x0084E802, 0x00850005, |
| 88 | 0x00852804, 0x00853C01, 0x0086426B, 0x00900027, 0x0091000B, |
| 89 | 0x0092704E, 0x00940276, 0x009E53E0, 0x00ADD820, 0x00AE6022, |
| 90 | 0x00AEF40C, 0x00AF2808, 0x00B39406, 0x00B3BC03, 0x00B3E404, |
| 91 | 0x00B3F802, 0x00B5C001, 0x00B5FC01, 0x00B7804F, 0x00B8C013, |
| 92 | 0x00BA001A, 0x00BA6C59, 0x00BC00D6, 0x00BFC00C, 0x00C00005, |
| 93 | 0x00C02019, 0x00C0A807, 0x00C0D802, 0x00C0F403, 0x00C26404, |
| 94 | 0x00C28001, 0x00C3EC01, 0x00C64002, 0x00C6580A, 0x00C70024, |
| 95 | 0x00C8001F, 0x00C8A81E, 0x00C94001, 0x00C98020, 0x00CA2827, |
| 96 | 0x00CB003F, 0x00CC0100, 0x01370040, 0x02924037, 0x0293F802, |
| 97 | 0x02983403, 0x0299BC10, 0x029A7C01, 0x029BC008, 0x029C0017, |
| 98 | 0x029C8002, 0x029E2402, 0x02A00801, 0x02A01801, 0x02A02C01, |
| 99 | 0x02A08C09, 0x02A0D804, 0x02A1D004, 0x02A20002, 0x02A2D011, |
| 100 | 0x02A33802, 0x02A38012, 0x02A3E003, 0x02A4980A, 0x02A51C0D, |
| 101 | 0x02A57C01, 0x02A60004, 0x02A6CC1B, 0x02A77802, 0x02A79401, |
| 102 | 0x02A8A40E, 0x02A90C01, 0x02A93002, 0x02A97004, 0x02A9DC03, |
| 103 | 0x02A9EC03, 0x02AAC001, 0x02AAC803, 0x02AADC02, 0x02AAF802, |
| 104 | 0x02AB0401, 0x02AB7802, 0x02ABAC07, 0x02ABD402, 0x02AD6C01, |
| 105 | 0x02AF8C0B, 0x03600001, 0x036DFC02, 0x036FFC02, 0x037FFC01, |
| 106 | 0x03EC7801, 0x03ECA401, 0x03EEC810, 0x03F4F802, 0x03F7F002, |
| 107 | 0x03F8001A, 0x03F8800E, 0x03F8C023, 0x03F95013, 0x03F9A004, |
| 108 | 0x03FBFC01, 0x03FC040F, 0x03FC6807, 0x03FCEC06, 0x03FD6C0B, |
| 109 | 0x03FF8007, 0x03FFA007, 0x03FFE405, 0x04040003, 0x0404DC09, |
| 110 | 0x0405E411, 0x04063001, 0x0406400C, 0x04068001, 0x0407402E, |
| 111 | 0x040B8001, 0x040DD805, 0x040E7C01, 0x040F4001, 0x0415BC01, |
| 112 | 0x04215C01, 0x0421DC02, 0x04247C01, 0x0424FC01, 0x04280403, |
| 113 | 0x04281402, 0x04283004, 0x0428E003, 0x0428FC01, 0x04294009, |
| 114 | 0x0429FC01, 0x042B2001, 0x042B9402, 0x042BC007, 0x042CE407, |
| 115 | 0x042E6404, 0x04400003, 0x0440E016, 0x0441FC04, 0x0442C012, |
| 116 | 0x04440003, 0x04449C0E, 0x04450004, 0x0445CC03, 0x04460003, |
| 117 | 0x0446CC0E, 0x04471404, 0x04473401, 0x0448B012, 0x044B7C0C, |
| 118 | 0x044C0403, 0x044CF001, 0x044CF807, 0x044D1C02, 0x044D2C03, |
| 119 | 0x044D5C01, 0x044D8802, 0x044D9807, 0x044DC005, 0x0452C014, |
| 120 | 0x04531801, 0x0456BC07, 0x0456E012, 0x0458C014, 0x045AAC0D, |
| 121 | 0x0491C005, 0x05A9B802, 0x05ABC006, 0x05ACC010, 0x05AD1002, |
| 122 | 0x05BD442E, 0x05BE3C04, 0x06F27008, 0x074000F6, 0x07440027, |
| 123 | 0x0744A4B5, 0x07480046, 0x074C0057, 0x075B0401, 0x075B6C01, |
| 124 | 0x075BEC01, 0x075C5401, 0x075CD401, 0x075D3C01, 0x075DBC01, |
| 125 | 0x075E2401, 0x075EA401, 0x075F0C01, 0x07A34007, 0x07BBC002, |
| 126 | 0x07C0002C, 0x07C0C064, 0x07C2800F, 0x07C2C40F, 0x07C3040F, |
| 127 | 0x07C34425, 0x07C4401F, 0x07C4C03C, 0x07C5C02B, 0x07C7981D, |
| 128 | 0x07C8402B, 0x07C90009, 0x07C94002, 0x07CC002D, 0x07CCC04E, |
| 129 | 0x07CE004F, 0x07CF5024, 0x07D000FF, 0x07D4004B, 0x07D5402A, |
| 130 | 0x07D5EC29, 0x07D6949E, 0x07D9148B, 0x07DB800D, 0x07DBC004, |
| 131 | 0x07DC0074, 0x07DE0055, 0x07E0000C, 0x07E04038, 0x07E1400A, |
| 132 | 0x07E18028, 0x07E2401E, 0x38000401, 0x38008060, 0x380400F0, |
| 133 | }; |
| 134 | static const unsigned int aAscii[4] = { |
| 135 | 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001, |
| 136 | }; |
| 137 | |
| @@ -160,35 +166,35 @@ | |
| 166 | ** SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER |
| 167 | ** E"). The resuls of passing a codepoint that corresponds to an |
| 168 | ** uppercase letter are undefined. |
| 169 | */ |
| 170 | static int unicode_remove_diacritic(int c){ |
| 171 | static const unsigned short aDia[] = { |
| 172 | 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, |
| 173 | 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, |
| 174 | 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, |
| 175 | 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, |
| 176 | 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, |
| 177 | 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, |
| 178 | 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, |
| 179 | 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, |
| 180 | 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, |
| 181 | 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, |
| 182 | 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, |
| 183 | 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, |
| 184 | 62924, 63050, 63082, 63274, 63390, |
| 185 | }; |
| 186 | static const char aChar[] = { |
| 187 | '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', |
| 188 | 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', |
| 189 | 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', |
| 190 | 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', |
| 191 | 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', |
| 192 | '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', |
| 193 | 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', |
| 194 | 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', |
| 195 | 'e', 'i', 'o', 'u', 'y', |
| 196 | }; |
| 197 | |
| 198 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 199 | int iRes = 0; |
| 200 | int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; |
| @@ -253,12 +259,12 @@ | |
| 259 | unsigned char flags; |
| 260 | unsigned char nRange; |
| 261 | } aEntry[] = { |
| 262 | {65, 14, 26}, {181, 64, 1}, {192, 14, 23}, |
| 263 | {216, 14, 7}, {256, 1, 48}, {306, 1, 6}, |
| 264 | {313, 1, 16}, {330, 1, 46}, {376, 126, 1}, |
| 265 | {377, 1, 6}, {383, 114, 1}, {385, 50, 1}, |
| 266 | {386, 1, 4}, {390, 44, 1}, {391, 0, 1}, |
| 267 | {393, 42, 2}, {395, 0, 1}, {398, 32, 1}, |
| 268 | {399, 38, 1}, {400, 40, 1}, {401, 0, 1}, |
| 269 | {403, 42, 1}, {404, 46, 1}, {406, 52, 1}, |
| 270 | {407, 48, 1}, {408, 0, 1}, {412, 52, 1}, |
| @@ -267,61 +273,64 @@ | |
| 273 | {428, 0, 1}, {430, 60, 1}, {431, 0, 1}, |
| 274 | {433, 58, 2}, {435, 1, 4}, {439, 62, 1}, |
| 275 | {440, 0, 1}, {444, 0, 1}, {452, 2, 1}, |
| 276 | {453, 0, 1}, {455, 2, 1}, {456, 0, 1}, |
| 277 | {458, 2, 1}, {459, 1, 18}, {478, 1, 18}, |
| 278 | {497, 2, 1}, {498, 1, 4}, {502, 132, 1}, |
| 279 | {503, 144, 1}, {504, 1, 40}, {544, 120, 1}, |
| 280 | {546, 1, 18}, {570, 70, 1}, {571, 0, 1}, |
| 281 | {573, 118, 1}, {574, 68, 1}, {577, 0, 1}, |
| 282 | {579, 116, 1}, {580, 28, 1}, {581, 30, 1}, |
| 283 | {582, 1, 10}, {837, 36, 1}, {880, 1, 4}, |
| 284 | {886, 0, 1}, {895, 36, 1}, {902, 18, 1}, |
| 285 | {904, 16, 3}, {908, 26, 1}, {910, 24, 2}, |
| 286 | {913, 14, 17}, {931, 14, 9}, {962, 0, 1}, |
| 287 | {975, 4, 1}, {976, 150, 1}, {977, 152, 1}, |
| 288 | {981, 156, 1}, {982, 154, 1}, {984, 1, 24}, |
| 289 | {1008, 146, 1}, {1009, 148, 1}, {1012, 140, 1}, |
| 290 | {1013, 138, 1}, {1015, 0, 1}, {1017, 162, 1}, |
| 291 | {1018, 0, 1}, {1021, 120, 3}, {1024, 34, 16}, |
| 292 | {1040, 14, 32}, {1120, 1, 34}, {1162, 1, 54}, |
| 293 | {1216, 6, 1}, {1217, 1, 14}, {1232, 1, 96}, |
| 294 | {1329, 22, 38}, {4256, 66, 38}, {4295, 66, 1}, |
| 295 | {4301, 66, 1}, {7680, 1, 150}, {7835, 142, 1}, |
| 296 | {7838, 106, 1}, {7840, 1, 96}, {7944, 160, 8}, |
| 297 | {7960, 160, 6}, {7976, 160, 8}, {7992, 160, 8}, |
| 298 | {8008, 160, 6}, {8025, 161, 8}, {8040, 160, 8}, |
| 299 | {8072, 160, 8}, {8088, 160, 8}, {8104, 160, 8}, |
| 300 | {8120, 160, 2}, {8122, 136, 2}, {8124, 158, 1}, |
| 301 | {8126, 110, 1}, {8136, 134, 4}, {8140, 158, 1}, |
| 302 | {8152, 160, 2}, {8154, 130, 2}, {8168, 160, 2}, |
| 303 | {8170, 128, 2}, {8172, 162, 1}, {8184, 122, 2}, |
| 304 | {8186, 124, 2}, {8188, 158, 1}, {8486, 108, 1}, |
| 305 | {8490, 102, 1}, {8491, 104, 1}, {8498, 12, 1}, |
| 306 | {8544, 8, 16}, {8579, 0, 1}, {9398, 10, 26}, |
| 307 | {11264, 22, 47}, {11360, 0, 1}, {11362, 98, 1}, |
| 308 | {11363, 112, 1}, {11364, 100, 1}, {11367, 1, 6}, |
| 309 | {11373, 94, 1}, {11374, 96, 1}, {11375, 90, 1}, |
| 310 | {11376, 92, 1}, {11378, 0, 1}, {11381, 0, 1}, |
| 311 | {11390, 88, 2}, {11392, 1, 100}, {11499, 1, 4}, |
| 312 | {11506, 0, 1}, {42560, 1, 46}, {42624, 1, 28}, |
| 313 | {42786, 1, 14}, {42802, 1, 62}, {42873, 1, 4}, |
| 314 | {42877, 86, 1}, {42878, 1, 10}, {42891, 0, 1}, |
| 315 | {42893, 82, 1}, {42896, 1, 4}, {42902, 1, 20}, |
| 316 | {42922, 76, 1}, {42923, 72, 1}, {42924, 74, 1}, |
| 317 | {42925, 78, 1}, {42928, 84, 1}, {42929, 80, 1}, |
| 318 | {65313, 14, 26}, |
| 319 | }; |
| 320 | static const unsigned short aiOff[] = { |
| 321 | 1, 2, 8, 15, 16, 26, 28, 32, |
| 322 | 37, 38, 40, 48, 63, 64, 69, 71, |
| 323 | 79, 80, 116, 202, 203, 205, 206, 207, |
| 324 | 209, 210, 211, 213, 214, 217, 218, 219, |
| 325 | 775, 7264, 10792, 10795, 23217, 23221, 23228, 23231, |
| 326 | 23254, 23256, 23278, 30204, 54721, 54753, 54754, 54756, |
| 327 | 54787, 54793, 54809, 57153, 57274, 57921, 58019, 58363, |
| 328 | 61722, 65268, 65341, 65373, 65406, 65408, 65410, 65415, |
| 329 | 65424, 65436, 65439, 65450, 65462, 65472, 65476, 65478, |
| 330 | 65480, 65482, 65488, 65506, 65511, 65514, 65521, 65527, |
| 331 | 65528, 65529, |
| 332 | }; |
| 333 | |
| 334 | int ret = c; |
| 335 | |
| 336 | assert( c>=0 ); |
| @@ -354,12 +363,15 @@ | |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | if( bRemoveDiacritic ) ret = unicode_remove_diacritic(ret); |
| 367 | } |
| 368 | |
| 369 | else if( c>=66560 && c<66600 ){ |
| 370 | ret = c + 40; |
| 371 | } |
| 372 | else if( c>=71840 && c<71872 ){ |
| 373 | ret = c + 32; |
| 374 | } |
| 375 | |
| 376 | return ret; |
| 377 | } |
| 378 |
+4
-4
| --- test/graph-test-1.wiki | ||
| +++ test/graph-test-1.wiki | ||
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <title>Graph Test One</title> |
| 2 | 2 | |
| 3 | 3 | This page contains examples a list of URLs of timelines with |
| 4 | -interesting graphs. Click on all URLs, one by one, to verify | |
| 4 | +interesting graphs. Click on all URLs, one by one, to verify | |
| 5 | 5 | the correct operation of the graph drawing logic. |
| 6 | 6 | |
| 7 | 7 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08" target="testwindow"> |
| 8 | 8 | 20-element timeline, check-ins only, before 2010-11-08</a> |
| 9 | 9 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08&ng" target="testwindow"> |
| @@ -12,13 +12,13 @@ | ||
| 12 | 12 | 20-element timeline, check-ins only, file changes, before 2010-11-08</a> |
| 13 | 13 | * <a href="../../../timeline?n=40&y=ci&b=2010-11-08" target="testwindow"> |
| 14 | 14 | 40-element timeline, check-ins only, before 2010-11-08</a> |
| 15 | 15 | * <a href="../../../timeline?n=1000&y=ci&b=2010-11-08" target="testwindow"> |
| 16 | 16 | 1000-element timeline, check-ins only, before 2010-11-08</a> |
| 17 | - * <a href="../../../timeline?n=10&c=2010-11-07+10:23:00" target="testwindow"> | |
| 17 | + * <a href="../../../timeline?n=10&c=2010-11-07T10:23:00" target="testwindow"> | |
| 18 | 18 | 10-elements circa 2010-11-07 10:23:00, with dividers</a> |
| 19 | - * <a href="../../../timeline?n=10&c=2010-11-07+10:23:00&nd" | |
| 19 | + * <a href="../../../timeline?n=10&c=2010-11-07T10:23:00&nd" | |
| 20 | 20 | target="testwindow"> |
| 21 | 21 | 10-elements circa 2010-11-07 10:23:00, without dividers</a> |
| 22 | 22 | * <a href="../../../timeline?f=3ea66260b5555" target="testwindow"> |
| 23 | 23 | Parents and children of check-in 3ea66260b5555</a> |
| 24 | 24 | * <a href="../../../timeline?d=e5fe4164f74a7576&p=e5fe4164f74a7576&n=3" |
| @@ -49,11 +49,11 @@ | ||
| 49 | 49 | * <a href="../../../timeline?a=1970-01-01" target="testwindow"> |
| 50 | 50 | 20 elements after 1970-01-01.</a> |
| 51 | 51 | * <a href="../../../timeline?n=100000000&y=ci" target="testwindow"> |
| 52 | 52 | All check-ins - a huge graph.</a> |
| 53 | 53 | * <a href="../../../timeline?f=8dfed953f7530442" target="testwindow"> |
| 54 | - This malformed commit has a | |
| 54 | + This malformed commit has a | |
| 55 | 55 | merge parent which is not a valid checkin.</a> |
| 56 | 56 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9" |
| 57 | 57 | target="testwindow"> |
| 58 | 58 | From e663bac6f7 to a298a0e2f9 by shortest path.</a> |
| 59 | 59 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9&nomerge" |
| 60 | 60 |
| --- test/graph-test-1.wiki | |
| +++ test/graph-test-1.wiki | |
| @@ -1,9 +1,9 @@ | |
| 1 | <title>Graph Test One</title> |
| 2 | |
| 3 | This page contains examples a list of URLs of timelines with |
| 4 | interesting graphs. Click on all URLs, one by one, to verify |
| 5 | the correct operation of the graph drawing logic. |
| 6 | |
| 7 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08" target="testwindow"> |
| 8 | 20-element timeline, check-ins only, before 2010-11-08</a> |
| 9 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08&ng" target="testwindow"> |
| @@ -12,13 +12,13 @@ | |
| 12 | 20-element timeline, check-ins only, file changes, before 2010-11-08</a> |
| 13 | * <a href="../../../timeline?n=40&y=ci&b=2010-11-08" target="testwindow"> |
| 14 | 40-element timeline, check-ins only, before 2010-11-08</a> |
| 15 | * <a href="../../../timeline?n=1000&y=ci&b=2010-11-08" target="testwindow"> |
| 16 | 1000-element timeline, check-ins only, before 2010-11-08</a> |
| 17 | * <a href="../../../timeline?n=10&c=2010-11-07+10:23:00" target="testwindow"> |
| 18 | 10-elements circa 2010-11-07 10:23:00, with dividers</a> |
| 19 | * <a href="../../../timeline?n=10&c=2010-11-07+10:23:00&nd" |
| 20 | target="testwindow"> |
| 21 | 10-elements circa 2010-11-07 10:23:00, without dividers</a> |
| 22 | * <a href="../../../timeline?f=3ea66260b5555" target="testwindow"> |
| 23 | Parents and children of check-in 3ea66260b5555</a> |
| 24 | * <a href="../../../timeline?d=e5fe4164f74a7576&p=e5fe4164f74a7576&n=3" |
| @@ -49,11 +49,11 @@ | |
| 49 | * <a href="../../../timeline?a=1970-01-01" target="testwindow"> |
| 50 | 20 elements after 1970-01-01.</a> |
| 51 | * <a href="../../../timeline?n=100000000&y=ci" target="testwindow"> |
| 52 | All check-ins - a huge graph.</a> |
| 53 | * <a href="../../../timeline?f=8dfed953f7530442" target="testwindow"> |
| 54 | This malformed commit has a |
| 55 | merge parent which is not a valid checkin.</a> |
| 56 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9" |
| 57 | target="testwindow"> |
| 58 | From e663bac6f7 to a298a0e2f9 by shortest path.</a> |
| 59 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9&nomerge" |
| 60 |
| --- test/graph-test-1.wiki | |
| +++ test/graph-test-1.wiki | |
| @@ -1,9 +1,9 @@ | |
| 1 | <title>Graph Test One</title> |
| 2 | |
| 3 | This page contains examples a list of URLs of timelines with |
| 4 | interesting graphs. Click on all URLs, one by one, to verify |
| 5 | the correct operation of the graph drawing logic. |
| 6 | |
| 7 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08" target="testwindow"> |
| 8 | 20-element timeline, check-ins only, before 2010-11-08</a> |
| 9 | * <a href="../../../timeline?n=20&y=ci&b=2010-11-08&ng" target="testwindow"> |
| @@ -12,13 +12,13 @@ | |
| 12 | 20-element timeline, check-ins only, file changes, before 2010-11-08</a> |
| 13 | * <a href="../../../timeline?n=40&y=ci&b=2010-11-08" target="testwindow"> |
| 14 | 40-element timeline, check-ins only, before 2010-11-08</a> |
| 15 | * <a href="../../../timeline?n=1000&y=ci&b=2010-11-08" target="testwindow"> |
| 16 | 1000-element timeline, check-ins only, before 2010-11-08</a> |
| 17 | * <a href="../../../timeline?n=10&c=2010-11-07T10:23:00" target="testwindow"> |
| 18 | 10-elements circa 2010-11-07 10:23:00, with dividers</a> |
| 19 | * <a href="../../../timeline?n=10&c=2010-11-07T10:23:00&nd" |
| 20 | target="testwindow"> |
| 21 | 10-elements circa 2010-11-07 10:23:00, without dividers</a> |
| 22 | * <a href="../../../timeline?f=3ea66260b5555" target="testwindow"> |
| 23 | Parents and children of check-in 3ea66260b5555</a> |
| 24 | * <a href="../../../timeline?d=e5fe4164f74a7576&p=e5fe4164f74a7576&n=3" |
| @@ -49,11 +49,11 @@ | |
| 49 | * <a href="../../../timeline?a=1970-01-01" target="testwindow"> |
| 50 | 20 elements after 1970-01-01.</a> |
| 51 | * <a href="../../../timeline?n=100000000&y=ci" target="testwindow"> |
| 52 | All check-ins - a huge graph.</a> |
| 53 | * <a href="../../../timeline?f=8dfed953f7530442" target="testwindow"> |
| 54 | This malformed commit has a |
| 55 | merge parent which is not a valid checkin.</a> |
| 56 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9" |
| 57 | target="testwindow"> |
| 58 | From e663bac6f7 to a298a0e2f9 by shortest path.</a> |
| 59 | * <a href="../../../timeline?from=e663bac6f7&to=a298a0e2f9&nomerge" |
| 60 |
+36
-3
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | # |
| 2 | 2 | # Tests for merging with renames |
| 3 | -# | |
| 3 | +# | |
| 4 | 4 | # |
| 5 | 5 | |
| 6 | 6 | catch {exec $::fossilexe info} res |
| 7 | 7 | puts res=$res |
| 8 | 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | ||
| 169 | 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | 170 | ###################################### |
| 171 | 171 | |
| 172 | 172 | # TO BE WRITTEN. |
| 173 | 173 | |
| 174 | +###################################### | |
| 175 | +# Test 5 # | |
| 176 | +# Handle Rename/Add via Merge # | |
| 177 | +###################################### | |
| 178 | + | |
| 179 | +repo_init | |
| 180 | + | |
| 181 | +write_file f1 "old f1 line" | |
| 182 | +fossil add f1 | |
| 183 | +fossil commit -m "base file" | |
| 184 | + | |
| 185 | +write_file f3 "f3 line" | |
| 186 | +fossil add f3 | |
| 187 | +fossil commit -m "branch file" -b branch_for_f3 | |
| 188 | + | |
| 189 | +fossil update trunk | |
| 190 | +fossil mv f1 f2 | |
| 191 | +file rename -force f1 f2 | |
| 192 | +write_file f1 "new f1 line" | |
| 193 | +fossil add f1 | |
| 194 | +fossil commit -m "rename and add file with old name" | |
| 195 | + | |
| 196 | +fossil update branch_for_f3 | |
| 197 | +fossil merge trunk | |
| 198 | +fossil commit -m "trunk merged, should have 3 files" | |
| 199 | + | |
| 200 | +fossil ls | |
| 201 | + | |
| 202 | +test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1 | |
| 203 | +f2 | |
| 204 | +f3}} | |
| 174 | 205 | |
| 206 | +###################################### | |
| 207 | +# | |
| 175 | 208 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 176 | 209 | # write: |
| 177 | 210 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 178 | -# [953031915f] - Lack of warning when overwriting extra files | |
| 179 | -# [4df5f38f1e] - Troubles merging a file delete with a file change | |
| 211 | +# [953031915f] - Lack of warning when overwriting extra files | |
| 212 | +# [4df5f38f1e] - Troubles merging a file delete with a file change | |
| 180 | 213 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,8 +1,8 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | catch {exec $::fossilexe info} res |
| 7 | puts res=$res |
| 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | |
| 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | ###################################### |
| 171 | |
| 172 | # TO BE WRITTEN. |
| 173 | |
| 174 | |
| 175 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 176 | # write: |
| 177 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 178 | # [953031915f] - Lack of warning when overwriting extra files |
| 179 | # [4df5f38f1e] - Troubles merging a file delete with a file change |
| 180 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,8 +1,8 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | catch {exec $::fossilexe info} res |
| 7 | puts res=$res |
| 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | |
| 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | ###################################### |
| 171 | |
| 172 | # TO BE WRITTEN. |
| 173 | |
| 174 | ###################################### |
| 175 | # Test 5 # |
| 176 | # Handle Rename/Add via Merge # |
| 177 | ###################################### |
| 178 | |
| 179 | repo_init |
| 180 | |
| 181 | write_file f1 "old f1 line" |
| 182 | fossil add f1 |
| 183 | fossil commit -m "base file" |
| 184 | |
| 185 | write_file f3 "f3 line" |
| 186 | fossil add f3 |
| 187 | fossil commit -m "branch file" -b branch_for_f3 |
| 188 | |
| 189 | fossil update trunk |
| 190 | fossil mv f1 f2 |
| 191 | file rename -force f1 f2 |
| 192 | write_file f1 "new f1 line" |
| 193 | fossil add f1 |
| 194 | fossil commit -m "rename and add file with old name" |
| 195 | |
| 196 | fossil update branch_for_f3 |
| 197 | fossil merge trunk |
| 198 | fossil commit -m "trunk merged, should have 3 files" |
| 199 | |
| 200 | fossil ls |
| 201 | |
| 202 | test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1 |
| 203 | f2 |
| 204 | f3}} |
| 205 | |
| 206 | ###################################### |
| 207 | # |
| 208 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 209 | # write: |
| 210 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 211 | # [953031915f] - Lack of warning when overwriting extra files |
| 212 | # [4df5f38f1e] - Troubles merging a file delete with a file change |
| 213 |
+1
-1
| --- win/Makefile.PellesCGMake | ||
| +++ win/Makefile.PellesCGMake | ||
| @@ -89,11 +89,11 @@ | ||
| 89 | 89 | |
| 90 | 90 | # define the sqlite shell files, which need special flags on compile |
| 91 | 91 | SQLITESHELLSRC=shell.c |
| 92 | 92 | ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf)) |
| 93 | 93 | SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj)) |
| 94 | -SQLITESHELLDEFINES=-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 | |
| 94 | +SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen | |
| 95 | 95 | |
| 96 | 96 | # define the th scripting files, which need special flags on compile |
| 97 | 97 | THSRC=th.c th_lang.c |
| 98 | 98 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 99 | 99 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 100 | 100 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -89,11 +89,11 @@ | |
| 89 | |
| 90 | # define the sqlite shell files, which need special flags on compile |
| 91 | SQLITESHELLSRC=shell.c |
| 92 | ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf)) |
| 93 | SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj)) |
| 94 | SQLITESHELLDEFINES=-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 |
| 95 | |
| 96 | # define the th scripting files, which need special flags on compile |
| 97 | THSRC=th.c th_lang.c |
| 98 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 99 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 100 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -89,11 +89,11 @@ | |
| 89 | |
| 90 | # define the sqlite shell files, which need special flags on compile |
| 91 | SQLITESHELLSRC=shell.c |
| 92 | ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf)) |
| 93 | SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj)) |
| 94 | SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 95 | |
| 96 | # define the th scripting files, which need special flags on compile |
| 97 | THSRC=th.c th_lang.c |
| 98 | ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf)) |
| 99 | THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj)) |
| 100 |
+1
-1
| --- win/Makefile.dmc | ||
| +++ win/Makefile.dmc | ||
| @@ -26,11 +26,11 @@ | ||
| 26 | 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | 27 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 |
| 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 | -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 | |
| 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 -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen | |
| 32 | 32 | |
| 33 | 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 | 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 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -26,11 +26,11 @@ | |
| 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 |
| 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 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -26,11 +26,11 @@ | |
| 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 |
| 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 -Dsystem=fossil_system -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 |
+1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -1780,10 +1780,11 @@ | ||
| 1780 | 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | 1784 | -Daccess=file_access \ |
| 1785 | + -Dsystem=fossil_system \ | |
| 1785 | 1786 | -Dgetenv=fossil_getenv \ |
| 1786 | 1787 | -Dfopen=fossil_fopen |
| 1787 | 1788 | |
| 1788 | 1789 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw |
| 1789 | 1790 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1790 | 1791 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -1780,10 +1780,11 @@ | |
| 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | -Daccess=file_access \ |
| 1785 | -Dgetenv=fossil_getenv \ |
| 1786 | -Dfopen=fossil_fopen |
| 1787 | |
| 1788 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw |
| 1789 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1790 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -1780,10 +1780,11 @@ | |
| 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | -Daccess=file_access \ |
| 1785 | -Dsystem=fossil_system \ |
| 1786 | -Dgetenv=fossil_getenv \ |
| 1787 | -Dfopen=fossil_fopen |
| 1788 | |
| 1789 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw |
| 1790 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1791 |
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -1780,10 +1780,11 @@ | ||
| 1780 | 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | 1784 | -Daccess=file_access \ |
| 1785 | + -Dsystem=fossil_system \ | |
| 1785 | 1786 | -Dgetenv=fossil_getenv \ |
| 1786 | 1787 | -Dfopen=fossil_fopen |
| 1787 | 1788 | |
| 1788 | 1789 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin |
| 1789 | 1790 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1790 | 1791 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -1780,10 +1780,11 @@ | |
| 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | -Daccess=file_access \ |
| 1785 | -Dgetenv=fossil_getenv \ |
| 1786 | -Dfopen=fossil_fopen |
| 1787 | |
| 1788 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin |
| 1789 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1790 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -1780,10 +1780,11 @@ | |
| 1780 | SHELL_OPTIONS = -Dmain=sqlite3_shell \ |
| 1781 | -DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 1782 | -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 1783 | -DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 1784 | -Daccess=file_access \ |
| 1785 | -Dsystem=fossil_system \ |
| 1786 | -Dgetenv=fossil_getenv \ |
| 1787 | -Dfopen=fossil_fopen |
| 1788 | |
| 1789 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin |
| 1790 | $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1791 |
+1
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -111,10 +111,11 @@ | ||
| 111 | 111 | SHELL_OPTIONS = /Dmain=sqlite3_shell \ |
| 112 | 112 | /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 113 | 113 | /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 114 | 114 | /DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 115 | 115 | /Daccess=file_access \ |
| 116 | + /Dsystem=fossil_system \ | |
| 116 | 117 | /Dgetenv=fossil_getenv \ |
| 117 | 118 | /Dfopen=fossil_fopen |
| 118 | 119 | |
| 119 | 120 | SRC = add_.c \ |
| 120 | 121 | allrepo_.c \ |
| 121 | 122 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -111,10 +111,11 @@ | |
| 111 | SHELL_OPTIONS = /Dmain=sqlite3_shell \ |
| 112 | /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 113 | /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 114 | /DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 115 | /Daccess=file_access \ |
| 116 | /Dgetenv=fossil_getenv \ |
| 117 | /Dfopen=fossil_fopen |
| 118 | |
| 119 | SRC = add_.c \ |
| 120 | allrepo_.c \ |
| 121 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -111,10 +111,11 @@ | |
| 111 | SHELL_OPTIONS = /Dmain=sqlite3_shell \ |
| 112 | /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 113 | /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \ |
| 114 | /DSQLITE_SHELL_DBNAME_PROC=fossil_open \ |
| 115 | /Daccess=file_access \ |
| 116 | /Dsystem=fossil_system \ |
| 117 | /Dgetenv=fossil_getenv \ |
| 118 | /Dfopen=fossil_fopen |
| 119 | |
| 120 | SRC = add_.c \ |
| 121 | allrepo_.c \ |
| 122 |
+29
-30
| --- www/branching.wiki | ||
| +++ www/branching.wiki | ||
| @@ -19,19 +19,19 @@ | ||
| 19 | 19 | |
| 20 | 20 | The arrows in figure 1 show the evolution of a project. The initial |
| 21 | 21 | check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2 |
| 22 | 22 | was created by making edits to check-in 1 and then committing those edits. |
| 23 | 23 | We say that 2 is a <i>child</i> of 1 |
| 24 | -and that 1 is a <i>parent</i> of 2. | |
| 24 | +and that 1 is a <i>parent</i> of 2. | |
| 25 | 25 | Check-in 3 is derived from check-in 2, making |
| 26 | 26 | 3 a child of 2. We say that 3 is a <i>descendant</i> of both 1 and 2 and that 1 |
| 27 | -and 2 are both <i>ancestors</i> of 3. | |
| 27 | +and 2 are both <i>ancestors</i> of 3. | |
| 28 | 28 | |
| 29 | 29 | <a name="dag"></a> |
| 30 | 30 | <h2>DAGs</h2> |
| 31 | 31 | |
| 32 | -The graph of check-ins is a | |
| 32 | +The graph of check-ins is a | |
| 33 | 33 | [http://en.wikipedia.org/wiki/Directed_acyclic_graph | directed acyclic graph] |
| 34 | 34 | commonly shortened to <i>DAG</i>. Check-in 1 is the <i>root</i> of the DAG |
| 35 | 35 | since it has no ancestors. Check-in 4 is a <i>leaf</i> of the DAG since |
| 36 | 36 | it has no descendants. (We will give a more precise definition later of |
| 37 | 37 | "leaf.") |
| @@ -47,29 +47,29 @@ | ||
| 47 | 47 | </td></tr></table></center> |
| 48 | 48 | |
| 49 | 49 | The graph in figure 2 has two leaves: check-ins 3 and 4. Check-in 2 has |
| 50 | 50 | two children, check-ins 3 and 4. We call this state a <i>fork</i>. |
| 51 | 51 | |
| 52 | -Fossil tries to prevent forks. Suppose two programmers named Alice and | |
| 53 | -Bob are each editing check-in 2 separately. Alice finishes her edits | |
| 54 | -first and commits her changes, resulting in check-in 3. Later, when Bob | |
| 55 | -attempts to commit his changes, fossil verifies that check-in 2 is still | |
| 56 | -a leaf. Fossil sees that check-in 3 has occurred and aborts Bob's commit | |
| 57 | -attempt with a message "would fork." This allows Bob to do a "fossil | |
| 58 | -update" which pulls in Alice's changes, merging them into his own | |
| 59 | -changes. After merging, Bob commits check-in 4 as a child of check-in 3. | |
| 60 | -The result is a linear graph as shown in figure 1. This is how CVS | |
| 61 | -works. This is also how fossil works in [./concepts.wiki#workflow | | |
| 62 | -"autosync"] mode. | |
| 52 | +Fossil tries to prevent forks. Suppose two programmers named Alice and | |
| 53 | +Bob are each editing check-in 2 separately. Alice finishes her edits | |
| 54 | +first and commits her changes, resulting in check-in 3. Later, when Bob | |
| 55 | +attempts to commit his changes, fossil verifies that check-in 2 is still | |
| 56 | +a leaf. Fossil sees that check-in 3 has occurred and aborts Bob's commit | |
| 57 | +attempt with a message "would fork." This allows Bob to do a "fossil | |
| 58 | +update" which pulls in Alice's changes, merging them into his own | |
| 59 | +changes. After merging, Bob commits check-in 4 as a child of check-in 3. | |
| 60 | +The result is a linear graph as shown in figure 1. This is how CVS | |
| 61 | +works. This is also how fossil works in [./concepts.wiki#workflow | | |
| 62 | +"autosync"] mode. | |
| 63 | 63 | |
| 64 | 64 | But perhaps Bob is off-network when he does his commit, so he |
| 65 | 65 | has no way of knowing that Alice has already committed her changes. |
| 66 | 66 | Or, it could be that Bob has turned off "autosync" mode in Fossil. Or, |
| 67 | 67 | maybe Bob just doesn't want to merge in Alice's changes before he has |
| 68 | -saved his own, so he forces the commit to occur using the "--force" option | |
| 69 | -to the fossil <b>commit</b> command. For any of these reasons, two commits against | |
| 70 | -check-in 2 have occurred and now the DAG has two leaves. | |
| 68 | +saved his own, so he forces the commit to occur using the "--allow-fork" | |
| 69 | +option to the fossil <b>commit</b> command. For any of these reasons, | |
| 70 | +two commits against check-in 2 have occurred and now the DAG has two leaves. | |
| 71 | 71 | |
| 72 | 72 | So which version of the project is the "latest" in the sense of having |
| 73 | 73 | the most features and the most bug fixes? When there is more than |
| 74 | 74 | one leaf in the graph, you don't really know. So we like to have |
| 75 | 75 | graphs with a single leaf. |
| @@ -86,11 +86,11 @@ | ||
| 86 | 86 | </td></tr></table></center> |
| 87 | 87 | |
| 88 | 88 | Check-in 5 is a child of check-in 3 because it was created by editing |
| 89 | 89 | check-in 3. But check-in 5 also inherits the changes from check-in 4 by |
| 90 | 90 | virtue of the merge. So we say that check-in 5 is a <i>merge child</i> |
| 91 | -of check-in 4 and that it is a <i>direct child</i> of check-in 3. | |
| 91 | +of check-in 4 and that it is a <i>direct child</i> of check-in 3. | |
| 92 | 92 | The graph is now back to a single leaf (check-in 5). |
| 93 | 93 | |
| 94 | 94 | We have already seen that if fossil is in autosync mode then Bob would |
| 95 | 95 | have been warned about the potential fork the first time he tried to |
| 96 | 96 | commit check-in 4. If Bob had updated his local check-out to merge in |
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | instead of as a separate manual step. We will not take sides in that |
| 113 | 113 | debate. We will simply point out that fossil enables you to do it either way. |
| 114 | 114 | |
| 115 | 115 | <h2>Forking Versus Branching</h2> |
| 116 | 116 | |
| 117 | -Having more than one leaf in the check-in DAG is called a "fork." This | |
| 117 | +Having more than one leaf in the check-in DAG is called a "fork." This | |
| 118 | 118 | is usually undesirable and either avoided entirely, |
| 119 | 119 | as in figure 1, or else quickly resolved as shown in figure 3. |
| 120 | 120 | But sometimes, one does want to have multiple leaves. For example, a project |
| 121 | 121 | might have one leaf that is the latest version of the project under |
| 122 | 122 | development and another leaf that is the latest version that has been |
| @@ -131,19 +131,19 @@ | ||
| 131 | 131 | <img src="branch04.gif" width=426 height=123><br> |
| 132 | 132 | Figure 4 |
| 133 | 133 | </td></tr></table></center> |
| 134 | 134 | |
| 135 | 135 | The hypothetical scenario of figure 4 is this: The project starts and |
| 136 | -progresses to a point where (at check-in 2) | |
| 136 | +progresses to a point where (at check-in 2) | |
| 137 | 137 | it is ready to enter testing for its first release. |
| 138 | 138 | In a real project, of course, there might be hundreds or thousands of |
| 139 | 139 | check-ins before a project reaches this point, but for simplicity of |
| 140 | 140 | presentation we will say that the project is ready after check-in 2. |
| 141 | 141 | The project then splits into two branches that are used by separate |
| 142 | 142 | teams. The testing team, using the blue branch, finds and fixes a few |
| 143 | 143 | bugs. This is shown by check-ins 6 and 9. Meanwhile the development |
| 144 | -team, working on the top uncolored branch, | |
| 144 | +team, working on the top uncolored branch, | |
| 145 | 145 | is busy adding features for the second |
| 146 | 146 | release. Of course, the development team would like to take advantage of |
| 147 | 147 | the bug fixes implemented by the testing team. So periodically, the |
| 148 | 148 | changes in the test branch are merged into the dev branch. This is |
| 149 | 149 | shown by the dashed merge arrows between check-ins 6 and 7 and between |
| @@ -174,13 +174,13 @@ | ||
| 174 | 174 | |
| 175 | 175 | A <i>tag</i> is a name that is attached to a check-in. A |
| 176 | 176 | <i>property</i> is a name/value pair. Internally, fossil implements |
| 177 | 177 | tags as properties with a NULL value. So, tags and properties really |
| 178 | 178 | are much the same thing, and henceforth we will use the word "tag" |
| 179 | -to mean either a tag or a property. | |
| 179 | +to mean either a tag or a property. | |
| 180 | 180 | |
| 181 | -A tag can be a one-time tag, a propagating tag or a cancellation tag. | |
| 181 | +A tag can be a one-time tag, a propagating tag or a cancellation tag. | |
| 182 | 182 | A one-time tag only applies to the check-in to which it is attached. A |
| 183 | 183 | propagating tag applies to the check-in to which it is attached and also |
| 184 | 184 | to all direct descendants of that check-in. A <i>direct descendant</i> |
| 185 | 185 | is a descendant through direct children. Tags propagation does not |
| 186 | 186 | cross merges. Tag propagation also stops as soon |
| @@ -187,14 +187,13 @@ | ||
| 187 | 187 | as it encounters another check-in with the same tag. A cancellation tag |
| 188 | 188 | is attached to a single check-in in order to either override a one-time |
| 189 | 189 | tag that was previously placed on that same check-in, or to block |
| 190 | 190 | tag propagation from an ancestor. |
| 191 | 191 | |
| 192 | -Every repository is created with a single empty check-in that has two | |
| 193 | -propagating tags. In figure 5, that initial empty check-in is check-in 1. | |
| 194 | -The <b>branch</b> tag tells (by its value) | |
| 195 | -what branch the check-in is a member of. | |
| 192 | +The initial checkin of every repository has two propagating tags. In | |
| 193 | +figure 5, that initial check-in is check-in 1. The <b>branch</b> tag | |
| 194 | +tells (by its value) what branch the check-in is a member of. | |
| 196 | 195 | The default branch is called "trunk." All tags that begin with "<b>sym-</b>" |
| 197 | 196 | are symbolic name tags. When a symbolic name tag is attached to a |
| 198 | 197 | check-in, that allows you to refer to that check-in by its symbolic |
| 199 | 198 | name rather than by its 40-character SHA1 hash name. When a symbolic name |
| 200 | 199 | tag propagates (as does the <b>sym-trunk</b> tag) then referring to that |
| @@ -212,12 +211,12 @@ | ||
| 212 | 211 | |
| 213 | 212 | Check-in 4 also has a <b>sym-test</b> tag, which gives the symbolic name |
| 214 | 213 | "test" to check-ins 4, 6, and 9. Because tags do not propagate across |
| 215 | 214 | merges, check-ins 7, 8, and 10 do not inherit the <b>sym-test</b> tag and |
| 216 | 215 | are hence not known by the name "test." |
| 217 | -To prevent the <b>sym-trunk</b> tag from propagating from check-in 1 | |
| 218 | -into check-ins 4, 6, and 9, there is a cancellation tag for | |
| 216 | +To prevent the <b>sym-trunk</b> tag from propagating from check-in 1 | |
| 217 | +into check-ins 4, 6, and 9, there is a cancellation tag for | |
| 219 | 218 | <b>sym-trunk</b> on check-in 4. The net effect is that |
| 220 | 219 | check-ins on the trunk go by the symbolic name of "trunk" and check-ins |
| 221 | 220 | on the test branch go by the symbolic name "test." |
| 222 | 221 | |
| 223 | 222 | The <b>bgcolor=blue</b> tag on check-in 4 causes the background color |
| @@ -225,11 +224,11 @@ | ||
| 225 | 224 | |
| 226 | 225 | Figure 5 also shows two one-time tags on check-in 9. (The diagram does |
| 227 | 226 | not make a graphical distinction between one-time and propagating tags.) |
| 228 | 227 | The <b>sym-release-1.0</b> tag means that check-in 9 can be referred to |
| 229 | 228 | using the more meaningful name "release-1.0." The <b>closed</b> tag means |
| 230 | -that check-in 9 is a "closed leaf." A closed leaf is a leaf that should | |
| 229 | +that check-in 9 is a "closed leaf." A closed leaf is a leaf that should | |
| 231 | 230 | never have direct children. |
| 232 | 231 | |
| 233 | 232 | <h2>Review Of Terminology</h2> |
| 234 | 233 | |
| 235 | 234 | <blockquote><dl> |
| 236 | 235 |
| --- www/branching.wiki | |
| +++ www/branching.wiki | |
| @@ -19,19 +19,19 @@ | |
| 19 | |
| 20 | The arrows in figure 1 show the evolution of a project. The initial |
| 21 | check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2 |
| 22 | was created by making edits to check-in 1 and then committing those edits. |
| 23 | We say that 2 is a <i>child</i> of 1 |
| 24 | and that 1 is a <i>parent</i> of 2. |
| 25 | Check-in 3 is derived from check-in 2, making |
| 26 | 3 a child of 2. We say that 3 is a <i>descendant</i> of both 1 and 2 and that 1 |
| 27 | and 2 are both <i>ancestors</i> of 3. |
| 28 | |
| 29 | <a name="dag"></a> |
| 30 | <h2>DAGs</h2> |
| 31 | |
| 32 | The graph of check-ins is a |
| 33 | [http://en.wikipedia.org/wiki/Directed_acyclic_graph | directed acyclic graph] |
| 34 | commonly shortened to <i>DAG</i>. Check-in 1 is the <i>root</i> of the DAG |
| 35 | since it has no ancestors. Check-in 4 is a <i>leaf</i> of the DAG since |
| 36 | it has no descendants. (We will give a more precise definition later of |
| 37 | "leaf.") |
| @@ -47,29 +47,29 @@ | |
| 47 | </td></tr></table></center> |
| 48 | |
| 49 | The graph in figure 2 has two leaves: check-ins 3 and 4. Check-in 2 has |
| 50 | two children, check-ins 3 and 4. We call this state a <i>fork</i>. |
| 51 | |
| 52 | Fossil tries to prevent forks. Suppose two programmers named Alice and |
| 53 | Bob are each editing check-in 2 separately. Alice finishes her edits |
| 54 | first and commits her changes, resulting in check-in 3. Later, when Bob |
| 55 | attempts to commit his changes, fossil verifies that check-in 2 is still |
| 56 | a leaf. Fossil sees that check-in 3 has occurred and aborts Bob's commit |
| 57 | attempt with a message "would fork." This allows Bob to do a "fossil |
| 58 | update" which pulls in Alice's changes, merging them into his own |
| 59 | changes. After merging, Bob commits check-in 4 as a child of check-in 3. |
| 60 | The result is a linear graph as shown in figure 1. This is how CVS |
| 61 | works. This is also how fossil works in [./concepts.wiki#workflow | |
| 62 | "autosync"] mode. |
| 63 | |
| 64 | But perhaps Bob is off-network when he does his commit, so he |
| 65 | has no way of knowing that Alice has already committed her changes. |
| 66 | Or, it could be that Bob has turned off "autosync" mode in Fossil. Or, |
| 67 | maybe Bob just doesn't want to merge in Alice's changes before he has |
| 68 | saved his own, so he forces the commit to occur using the "--force" option |
| 69 | to the fossil <b>commit</b> command. For any of these reasons, two commits against |
| 70 | check-in 2 have occurred and now the DAG has two leaves. |
| 71 | |
| 72 | So which version of the project is the "latest" in the sense of having |
| 73 | the most features and the most bug fixes? When there is more than |
| 74 | one leaf in the graph, you don't really know. So we like to have |
| 75 | graphs with a single leaf. |
| @@ -86,11 +86,11 @@ | |
| 86 | </td></tr></table></center> |
| 87 | |
| 88 | Check-in 5 is a child of check-in 3 because it was created by editing |
| 89 | check-in 3. But check-in 5 also inherits the changes from check-in 4 by |
| 90 | virtue of the merge. So we say that check-in 5 is a <i>merge child</i> |
| 91 | of check-in 4 and that it is a <i>direct child</i> of check-in 3. |
| 92 | The graph is now back to a single leaf (check-in 5). |
| 93 | |
| 94 | We have already seen that if fossil is in autosync mode then Bob would |
| 95 | have been warned about the potential fork the first time he tried to |
| 96 | commit check-in 4. If Bob had updated his local check-out to merge in |
| @@ -112,11 +112,11 @@ | |
| 112 | instead of as a separate manual step. We will not take sides in that |
| 113 | debate. We will simply point out that fossil enables you to do it either way. |
| 114 | |
| 115 | <h2>Forking Versus Branching</h2> |
| 116 | |
| 117 | Having more than one leaf in the check-in DAG is called a "fork." This |
| 118 | is usually undesirable and either avoided entirely, |
| 119 | as in figure 1, or else quickly resolved as shown in figure 3. |
| 120 | But sometimes, one does want to have multiple leaves. For example, a project |
| 121 | might have one leaf that is the latest version of the project under |
| 122 | development and another leaf that is the latest version that has been |
| @@ -131,19 +131,19 @@ | |
| 131 | <img src="branch04.gif" width=426 height=123><br> |
| 132 | Figure 4 |
| 133 | </td></tr></table></center> |
| 134 | |
| 135 | The hypothetical scenario of figure 4 is this: The project starts and |
| 136 | progresses to a point where (at check-in 2) |
| 137 | it is ready to enter testing for its first release. |
| 138 | In a real project, of course, there might be hundreds or thousands of |
| 139 | check-ins before a project reaches this point, but for simplicity of |
| 140 | presentation we will say that the project is ready after check-in 2. |
| 141 | The project then splits into two branches that are used by separate |
| 142 | teams. The testing team, using the blue branch, finds and fixes a few |
| 143 | bugs. This is shown by check-ins 6 and 9. Meanwhile the development |
| 144 | team, working on the top uncolored branch, |
| 145 | is busy adding features for the second |
| 146 | release. Of course, the development team would like to take advantage of |
| 147 | the bug fixes implemented by the testing team. So periodically, the |
| 148 | changes in the test branch are merged into the dev branch. This is |
| 149 | shown by the dashed merge arrows between check-ins 6 and 7 and between |
| @@ -174,13 +174,13 @@ | |
| 174 | |
| 175 | A <i>tag</i> is a name that is attached to a check-in. A |
| 176 | <i>property</i> is a name/value pair. Internally, fossil implements |
| 177 | tags as properties with a NULL value. So, tags and properties really |
| 178 | are much the same thing, and henceforth we will use the word "tag" |
| 179 | to mean either a tag or a property. |
| 180 | |
| 181 | A tag can be a one-time tag, a propagating tag or a cancellation tag. |
| 182 | A one-time tag only applies to the check-in to which it is attached. A |
| 183 | propagating tag applies to the check-in to which it is attached and also |
| 184 | to all direct descendants of that check-in. A <i>direct descendant</i> |
| 185 | is a descendant through direct children. Tags propagation does not |
| 186 | cross merges. Tag propagation also stops as soon |
| @@ -187,14 +187,13 @@ | |
| 187 | as it encounters another check-in with the same tag. A cancellation tag |
| 188 | is attached to a single check-in in order to either override a one-time |
| 189 | tag that was previously placed on that same check-in, or to block |
| 190 | tag propagation from an ancestor. |
| 191 | |
| 192 | Every repository is created with a single empty check-in that has two |
| 193 | propagating tags. In figure 5, that initial empty check-in is check-in 1. |
| 194 | The <b>branch</b> tag tells (by its value) |
| 195 | what branch the check-in is a member of. |
| 196 | The default branch is called "trunk." All tags that begin with "<b>sym-</b>" |
| 197 | are symbolic name tags. When a symbolic name tag is attached to a |
| 198 | check-in, that allows you to refer to that check-in by its symbolic |
| 199 | name rather than by its 40-character SHA1 hash name. When a symbolic name |
| 200 | tag propagates (as does the <b>sym-trunk</b> tag) then referring to that |
| @@ -212,12 +211,12 @@ | |
| 212 | |
| 213 | Check-in 4 also has a <b>sym-test</b> tag, which gives the symbolic name |
| 214 | "test" to check-ins 4, 6, and 9. Because tags do not propagate across |
| 215 | merges, check-ins 7, 8, and 10 do not inherit the <b>sym-test</b> tag and |
| 216 | are hence not known by the name "test." |
| 217 | To prevent the <b>sym-trunk</b> tag from propagating from check-in 1 |
| 218 | into check-ins 4, 6, and 9, there is a cancellation tag for |
| 219 | <b>sym-trunk</b> on check-in 4. The net effect is that |
| 220 | check-ins on the trunk go by the symbolic name of "trunk" and check-ins |
| 221 | on the test branch go by the symbolic name "test." |
| 222 | |
| 223 | The <b>bgcolor=blue</b> tag on check-in 4 causes the background color |
| @@ -225,11 +224,11 @@ | |
| 225 | |
| 226 | Figure 5 also shows two one-time tags on check-in 9. (The diagram does |
| 227 | not make a graphical distinction between one-time and propagating tags.) |
| 228 | The <b>sym-release-1.0</b> tag means that check-in 9 can be referred to |
| 229 | using the more meaningful name "release-1.0." The <b>closed</b> tag means |
| 230 | that check-in 9 is a "closed leaf." A closed leaf is a leaf that should |
| 231 | never have direct children. |
| 232 | |
| 233 | <h2>Review Of Terminology</h2> |
| 234 | |
| 235 | <blockquote><dl> |
| 236 |
| --- www/branching.wiki | |
| +++ www/branching.wiki | |
| @@ -19,19 +19,19 @@ | |
| 19 | |
| 20 | The arrows in figure 1 show the evolution of a project. The initial |
| 21 | check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2 |
| 22 | was created by making edits to check-in 1 and then committing those edits. |
| 23 | We say that 2 is a <i>child</i> of 1 |
| 24 | and that 1 is a <i>parent</i> of 2. |
| 25 | Check-in 3 is derived from check-in 2, making |
| 26 | 3 a child of 2. We say that 3 is a <i>descendant</i> of both 1 and 2 and that 1 |
| 27 | and 2 are both <i>ancestors</i> of 3. |
| 28 | |
| 29 | <a name="dag"></a> |
| 30 | <h2>DAGs</h2> |
| 31 | |
| 32 | The graph of check-ins is a |
| 33 | [http://en.wikipedia.org/wiki/Directed_acyclic_graph | directed acyclic graph] |
| 34 | commonly shortened to <i>DAG</i>. Check-in 1 is the <i>root</i> of the DAG |
| 35 | since it has no ancestors. Check-in 4 is a <i>leaf</i> of the DAG since |
| 36 | it has no descendants. (We will give a more precise definition later of |
| 37 | "leaf.") |
| @@ -47,29 +47,29 @@ | |
| 47 | </td></tr></table></center> |
| 48 | |
| 49 | The graph in figure 2 has two leaves: check-ins 3 and 4. Check-in 2 has |
| 50 | two children, check-ins 3 and 4. We call this state a <i>fork</i>. |
| 51 | |
| 52 | Fossil tries to prevent forks. Suppose two programmers named Alice and |
| 53 | Bob are each editing check-in 2 separately. Alice finishes her edits |
| 54 | first and commits her changes, resulting in check-in 3. Later, when Bob |
| 55 | attempts to commit his changes, fossil verifies that check-in 2 is still |
| 56 | a leaf. Fossil sees that check-in 3 has occurred and aborts Bob's commit |
| 57 | attempt with a message "would fork." This allows Bob to do a "fossil |
| 58 | update" which pulls in Alice's changes, merging them into his own |
| 59 | changes. After merging, Bob commits check-in 4 as a child of check-in 3. |
| 60 | The result is a linear graph as shown in figure 1. This is how CVS |
| 61 | works. This is also how fossil works in [./concepts.wiki#workflow | |
| 62 | "autosync"] mode. |
| 63 | |
| 64 | But perhaps Bob is off-network when he does his commit, so he |
| 65 | has no way of knowing that Alice has already committed her changes. |
| 66 | Or, it could be that Bob has turned off "autosync" mode in Fossil. Or, |
| 67 | maybe Bob just doesn't want to merge in Alice's changes before he has |
| 68 | saved his own, so he forces the commit to occur using the "--allow-fork" |
| 69 | option to the fossil <b>commit</b> command. For any of these reasons, |
| 70 | two commits against check-in 2 have occurred and now the DAG has two leaves. |
| 71 | |
| 72 | So which version of the project is the "latest" in the sense of having |
| 73 | the most features and the most bug fixes? When there is more than |
| 74 | one leaf in the graph, you don't really know. So we like to have |
| 75 | graphs with a single leaf. |
| @@ -86,11 +86,11 @@ | |
| 86 | </td></tr></table></center> |
| 87 | |
| 88 | Check-in 5 is a child of check-in 3 because it was created by editing |
| 89 | check-in 3. But check-in 5 also inherits the changes from check-in 4 by |
| 90 | virtue of the merge. So we say that check-in 5 is a <i>merge child</i> |
| 91 | of check-in 4 and that it is a <i>direct child</i> of check-in 3. |
| 92 | The graph is now back to a single leaf (check-in 5). |
| 93 | |
| 94 | We have already seen that if fossil is in autosync mode then Bob would |
| 95 | have been warned about the potential fork the first time he tried to |
| 96 | commit check-in 4. If Bob had updated his local check-out to merge in |
| @@ -112,11 +112,11 @@ | |
| 112 | instead of as a separate manual step. We will not take sides in that |
| 113 | debate. We will simply point out that fossil enables you to do it either way. |
| 114 | |
| 115 | <h2>Forking Versus Branching</h2> |
| 116 | |
| 117 | Having more than one leaf in the check-in DAG is called a "fork." This |
| 118 | is usually undesirable and either avoided entirely, |
| 119 | as in figure 1, or else quickly resolved as shown in figure 3. |
| 120 | But sometimes, one does want to have multiple leaves. For example, a project |
| 121 | might have one leaf that is the latest version of the project under |
| 122 | development and another leaf that is the latest version that has been |
| @@ -131,19 +131,19 @@ | |
| 131 | <img src="branch04.gif" width=426 height=123><br> |
| 132 | Figure 4 |
| 133 | </td></tr></table></center> |
| 134 | |
| 135 | The hypothetical scenario of figure 4 is this: The project starts and |
| 136 | progresses to a point where (at check-in 2) |
| 137 | it is ready to enter testing for its first release. |
| 138 | In a real project, of course, there might be hundreds or thousands of |
| 139 | check-ins before a project reaches this point, but for simplicity of |
| 140 | presentation we will say that the project is ready after check-in 2. |
| 141 | The project then splits into two branches that are used by separate |
| 142 | teams. The testing team, using the blue branch, finds and fixes a few |
| 143 | bugs. This is shown by check-ins 6 and 9. Meanwhile the development |
| 144 | team, working on the top uncolored branch, |
| 145 | is busy adding features for the second |
| 146 | release. Of course, the development team would like to take advantage of |
| 147 | the bug fixes implemented by the testing team. So periodically, the |
| 148 | changes in the test branch are merged into the dev branch. This is |
| 149 | shown by the dashed merge arrows between check-ins 6 and 7 and between |
| @@ -174,13 +174,13 @@ | |
| 174 | |
| 175 | A <i>tag</i> is a name that is attached to a check-in. A |
| 176 | <i>property</i> is a name/value pair. Internally, fossil implements |
| 177 | tags as properties with a NULL value. So, tags and properties really |
| 178 | are much the same thing, and henceforth we will use the word "tag" |
| 179 | to mean either a tag or a property. |
| 180 | |
| 181 | A tag can be a one-time tag, a propagating tag or a cancellation tag. |
| 182 | A one-time tag only applies to the check-in to which it is attached. A |
| 183 | propagating tag applies to the check-in to which it is attached and also |
| 184 | to all direct descendants of that check-in. A <i>direct descendant</i> |
| 185 | is a descendant through direct children. Tags propagation does not |
| 186 | cross merges. Tag propagation also stops as soon |
| @@ -187,14 +187,13 @@ | |
| 187 | as it encounters another check-in with the same tag. A cancellation tag |
| 188 | is attached to a single check-in in order to either override a one-time |
| 189 | tag that was previously placed on that same check-in, or to block |
| 190 | tag propagation from an ancestor. |
| 191 | |
| 192 | The initial checkin of every repository has two propagating tags. In |
| 193 | figure 5, that initial check-in is check-in 1. The <b>branch</b> tag |
| 194 | tells (by its value) what branch the check-in is a member of. |
| 195 | The default branch is called "trunk." All tags that begin with "<b>sym-</b>" |
| 196 | are symbolic name tags. When a symbolic name tag is attached to a |
| 197 | check-in, that allows you to refer to that check-in by its symbolic |
| 198 | name rather than by its 40-character SHA1 hash name. When a symbolic name |
| 199 | tag propagates (as does the <b>sym-trunk</b> tag) then referring to that |
| @@ -212,12 +211,12 @@ | |
| 211 | |
| 212 | Check-in 4 also has a <b>sym-test</b> tag, which gives the symbolic name |
| 213 | "test" to check-ins 4, 6, and 9. Because tags do not propagate across |
| 214 | merges, check-ins 7, 8, and 10 do not inherit the <b>sym-test</b> tag and |
| 215 | are hence not known by the name "test." |
| 216 | To prevent the <b>sym-trunk</b> tag from propagating from check-in 1 |
| 217 | into check-ins 4, 6, and 9, there is a cancellation tag for |
| 218 | <b>sym-trunk</b> on check-in 4. The net effect is that |
| 219 | check-ins on the trunk go by the symbolic name of "trunk" and check-ins |
| 220 | on the test branch go by the symbolic name "test." |
| 221 | |
| 222 | The <b>bgcolor=blue</b> tag on check-in 4 causes the background color |
| @@ -225,11 +224,11 @@ | |
| 224 | |
| 225 | Figure 5 also shows two one-time tags on check-in 9. (The diagram does |
| 226 | not make a graphical distinction between one-time and propagating tags.) |
| 227 | The <b>sym-release-1.0</b> tag means that check-in 9 can be referred to |
| 228 | using the more meaningful name "release-1.0." The <b>closed</b> tag means |
| 229 | that check-in 9 is a "closed leaf." A closed leaf is a leaf that should |
| 230 | never have direct children. |
| 231 | |
| 232 | <h2>Review Of Terminology</h2> |
| 233 | |
| 234 | <blockquote><dl> |
| 235 |
+12
-3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -1,20 +1,29 @@ | ||
| 1 | 1 | <title>Change Log</title> |
| 2 | 2 | |
| 3 | 3 | <h2>Changes For Version 1.30 (as yet unreleased)</h2> |
| 4 | 4 | * Add setting to control the number of times autosync will be tried before |
| 5 | 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. | |
| 6 | + * Add the [/help/fusefs|fossil fusefs DIRECTORY] command that mounts a | |
| 7 | + Fuse Filesystem at the given DIRECTORY and populates it with read-only | |
| 8 | + copies of all historical check-ins. This only works on systems that | |
| 9 | + support FuseFS. | |
| 9 | 10 | * Support customization of commands and webpages, including the ability to |
| 10 | 11 | add new ones, via the "TH1 hooks" feature. Disabled by default. Enabled |
| 11 | 12 | via a compile-time option. |
| 12 | 13 | * Add the <nowiki>[checkout], [render], [styleHeader], [styleFooter], |
| 13 | 14 | [trace], [getParameter], [setParameter], and [artifact]</nowiki> commands |
| 14 | 15 | to TH1, primarily for use by TH1 hooks. |
| 15 | 16 | * Bring in the latest version of autosetup from upstream. |
| 17 | + * When committing a (non-binary) file which contains bytes forming an | |
| 18 | + invalid UTF-8 stream, fossil now adds the possibility to convert it | |
| 19 | + to a valid UTF-8 stream ('c') if you like. | |
| 20 | + * Let [/help?cmd=new|fossil new] no longer create an initial empty commit | |
| 21 | + by default. The first commit after checking out an empty repository will | |
| 22 | + become the initial commit. (NOT PLANNED FOR 1.30, BUT DONE TO EXPOSE | |
| 23 | + [/help?cmd=new|fossil new --empty] TO MORE FIELD TESTING BEFORE | |
| 24 | + MAKING ANY DECISION ON IT!) | |
| 16 | 25 | |
| 17 | 26 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 18 | 27 | * Add the ability to display content, diffs and annotations for UTF16 |
| 19 | 28 | text files in the web interface. |
| 20 | 29 | * Add the "SaveAs..." and "Invert" buttons |
| 21 | 30 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,20 +1,29 @@ | |
| 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 | * Support customization of commands and webpages, including the ability to |
| 10 | add new ones, via the "TH1 hooks" feature. Disabled by default. Enabled |
| 11 | via a compile-time option. |
| 12 | * Add the <nowiki>[checkout], [render], [styleHeader], [styleFooter], |
| 13 | [trace], [getParameter], [setParameter], and [artifact]</nowiki> commands |
| 14 | to TH1, primarily for use by TH1 hooks. |
| 15 | * Bring in the latest version of autosetup from upstream. |
| 16 | |
| 17 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 18 | * Add the ability to display content, diffs and annotations for UTF16 |
| 19 | text files in the web interface. |
| 20 | * Add the "SaveAs..." and "Invert" buttons |
| 21 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,20 +1,29 @@ | |
| 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 [/help/fusefs|fossil fusefs DIRECTORY] command that mounts a |
| 7 | Fuse Filesystem at the given DIRECTORY and populates it with read-only |
| 8 | copies of all historical check-ins. This only works on systems that |
| 9 | support FuseFS. |
| 10 | * Support customization of commands and webpages, including the ability to |
| 11 | add new ones, via the "TH1 hooks" feature. Disabled by default. Enabled |
| 12 | via a compile-time option. |
| 13 | * Add the <nowiki>[checkout], [render], [styleHeader], [styleFooter], |
| 14 | [trace], [getParameter], [setParameter], and [artifact]</nowiki> commands |
| 15 | to TH1, primarily for use by TH1 hooks. |
| 16 | * Bring in the latest version of autosetup from upstream. |
| 17 | * When committing a (non-binary) file which contains bytes forming an |
| 18 | invalid UTF-8 stream, fossil now adds the possibility to convert it |
| 19 | to a valid UTF-8 stream ('c') if you like. |
| 20 | * Let [/help?cmd=new|fossil new] no longer create an initial empty commit |
| 21 | by default. The first commit after checking out an empty repository will |
| 22 | become the initial commit. (NOT PLANNED FOR 1.30, BUT DONE TO EXPOSE |
| 23 | [/help?cmd=new|fossil new --empty] TO MORE FIELD TESTING BEFORE |
| 24 | MAKING ANY DECISION ON IT!) |
| 25 | |
| 26 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 27 | * Add the ability to display content, diffs and annotations for UTF16 |
| 28 | text files in the web interface. |
| 29 | * Add the "SaveAs..." and "Invert" buttons |
| 30 |
+15
-15
| --- www/fossil-v-git.wiki | ||
| +++ www/fossil-v-git.wiki | ||
| @@ -3,15 +3,15 @@ | ||
| 3 | 3 | <h2>1.0 Don't Stress!</h2> |
| 4 | 4 | |
| 5 | 5 | If you start out using one DVCS and later decide you like the other better, |
| 6 | 6 | it is [./inout.wiki | easy to change]. |
| 7 | 7 | |
| 8 | -But it also helps to be informed about the differences between | |
| 8 | +But it also helps to be informed about the differences between | |
| 9 | 9 | [http://git-scm.com | Git] and Fossil. See the table below for |
| 10 | 10 | a high-level summary and the text that follows for more details. |
| 11 | 11 | |
| 12 | -Keep in mind that you are reading this on a Fossil website, | |
| 12 | +Keep in mind that you are reading this on a Fossil website, | |
| 13 | 13 | so the information here |
| 14 | 14 | might be biased in favor of Fossil. Ask around with people who have |
| 15 | 15 | used both Fossil and Git for other opinions. |
| 16 | 16 | |
| 17 | 17 | <h2>2.0 Executive Summary:</h2> |
| @@ -47,21 +47,21 @@ | ||
| 47 | 47 | <h3>3.2 Sharding versus Replicating</h3> |
| 48 | 48 | |
| 49 | 49 | Git makes it easy for each repository in a project to hold a subset of |
| 50 | 50 | the branches for that project. In fact, it is entirely possible and not |
| 51 | 51 | uncommon for no repository in the project to hold all the different code |
| 52 | -versions for a project. Instead the information is distributed. | |
| 52 | +versions for a project. Instead the information is distributed. | |
| 53 | 53 | Individual developers have one or more private branches. A hierarchy |
| 54 | 54 | of integrators merge changes from individual developers into collaborative |
| 55 | 55 | branches, until all the changes are merged together at the top-level master |
| 56 | 56 | branch. And all of this can be accomplished without having to have all the |
| 57 | 57 | code in any one repository. Developers or groups of developers can share |
| 58 | 58 | only those branches that they want to share and keep other branchs of the |
| 59 | 59 | project private. This is analogous to sharding an a distributed database. |
| 60 | 60 | |
| 61 | 61 | Fossil allows private branches, but its default mode is to share everything. |
| 62 | -And so in a Fossil project, all respositories tend to contain all of the | |
| 62 | +And so in a Fossil project, all repositories tend to contain all of the | |
| 63 | 63 | content at all times. This is analogous to replication in a |
| 64 | 64 | distributed database. |
| 65 | 65 | |
| 66 | 66 | The Git model works best for large projects, like the |
| 67 | 67 | Linux kernel for which Git was designed. |
| @@ -73,35 +73,35 @@ | ||
| 73 | 73 | works in his or her own branch and then merges changes up the hierarchy |
| 74 | 74 | until they reach the master branch. |
| 75 | 75 | |
| 76 | 76 | Fossil is designed for smaller and non-hierarchical teams where all |
| 77 | 77 | developers are operating directly on the master branch, or at most |
| 78 | -a small number of well defined branches. | |
| 78 | +a small number of well defined branches. | |
| 79 | 79 | The [./concepts.wiki#workflow | autosync] mode of Fossil makes it easy |
| 80 | 80 | for multiple developers to work on a single branch and maintain |
| 81 | 81 | linear development on that branch and avoid needless forking |
| 82 | 82 | and merging. |
| 83 | 83 | |
| 84 | 84 | <h3>3.3 Branches</h3> |
| 85 | 85 | |
| 86 | -Git (and especially GitHub) encourages a workflow where each developer | |
| 86 | +Git (and especially GitHub) encourages a workflow where each developer | |
| 87 | 87 | has his or her own branch or branches. Developers then send "pull requests" |
| 88 | 88 | to have their changes be merged into "official" branches by integrators. |
| 89 | 89 | For example, the Linux kernel team has a hierarchy of integrators with |
| 90 | 90 | Linus Torvalds at the root. Individual developers each have their own |
| 91 | 91 | private branches of the source tree into which they make their own changes. |
| 92 | 92 | They then encourage first-tier integrators to pull those changes. The |
| 93 | 93 | first-tier integrators merge together changes from multiple contributors |
| 94 | 94 | then try to get second-tier integrators to pull their branches. The |
| 95 | -changes merge up the hierarchy until (hopefully) they are pulled into | |
| 95 | +changes merge up the hierarchy until (hopefully) they are pulled into | |
| 96 | 96 | "Linus's branch", at which time they become part of the "official" Linux. |
| 97 | 97 | |
| 98 | 98 | In Git, each branch is "owned" by the person who creates it and works |
| 99 | 99 | on it. The owner might pull changes from others, but the owner is always |
| 100 | 100 | in control of the branch. Branches are developer-centric. |
| 101 | 101 | |
| 102 | -Fossil, on the other hand, encourages a workflow where branches are | |
| 102 | +Fossil, on the other hand, encourages a workflow where branches are | |
| 103 | 103 | associated with features or releases, not individual developers. |
| 104 | 104 | All developers share all branches in common, and two |
| 105 | 105 | or more developers can and often do intersperse commits onto the same branch. |
| 106 | 106 | Branches do not belong to individuals. All branches are read/write |
| 107 | 107 | accessible to all developers at all times. There is no need |
| @@ -113,11 +113,11 @@ | ||
| 113 | 113 | branches in Fossil are feature-centric. |
| 114 | 114 | |
| 115 | 115 | The Git approach scales much better for large projects like the Linux |
| 116 | 116 | kernel with thousands of contributors who in many cases don't even know |
| 117 | 117 | each others names. The integrators serve a gatekeeper role to help keep |
| 118 | -undesirable code out of the official Linux source tree. On the other hand, | |
| 118 | +undesirable code out of the official Linux source tree. On the other hand, | |
| 119 | 119 | not many projects are as big or as loosely organized as the Linux kernel. |
| 120 | 120 | Most projects have a small team of developers who all know each other |
| 121 | 121 | well and trust each other, and who enjoy working together collaboratively |
| 122 | 122 | without the overhead and hierarchy of integrators. |
| 123 | 123 | |
| @@ -141,14 +141,14 @@ | ||
| 141 | 141 | to think about version control to some extent. But one wants to minimize |
| 142 | 142 | the thinking about version control. |
| 143 | 143 | |
| 144 | 144 | Git requires the developer to maintain a more complex mental model than |
| 145 | 145 | most other DVCSes. Git takes longer to learn. And you have to spend |
| 146 | -more time thinking about what you are doing with Git. | |
| 146 | +more time thinking about what you are doing with Git. | |
| 147 | 147 | |
| 148 | 148 | Fossil strives for simplicity. Fossil wants to be easy to learn and to |
| 149 | -require little thinking about how to operating it. | |
| 149 | +require little thinking about how to operating it. | |
| 150 | 150 | [./quotes.wiki | Reports from the field] |
| 151 | 151 | indicate that Fossil is mostly successful at this effort. |
| 152 | 152 | |
| 153 | 153 | <h3>3.5 Web Interface</h3> |
| 154 | 154 | |
| @@ -195,17 +195,17 @@ | ||
| 195 | 195 | |
| 196 | 196 | Git features the "rebase" command which can be used to change the |
| 197 | 197 | sequence of check-ins in the repository. Rebase can be used to "clean up" |
| 198 | 198 | a complex sequence of check-ins to make their intent easier for others |
| 199 | 199 | to understand. This is important if you view the history of a project |
| 200 | -as part of the documentation for the project. | |
| 200 | +as part of the documentation for the project. | |
| 201 | 201 | |
| 202 | 202 | Fossil takes an opposing view. Fossil views history as sacrosanct and |
| 203 | 203 | stubornly refuses to change it. |
| 204 | 204 | Fossil allows mistakes to be corrected (for example, check-in comments |
| 205 | 205 | can be revised, and check-ins can be moved onto new branches even after |
| 206 | -the check-in has occurred) but the correction is an addition to the respository | |
| 206 | +the check-in has occurred) but the correction is an addition to the repository | |
| 207 | 207 | and the original actions are preserved and displayed alongside |
| 208 | 208 | the corrections, thus preserving an historically accurate audit trail. |
| 209 | 209 | This is analogous to an accountant marking through an incorrect |
| 210 | 210 | entry in a ledger and writing in a correction beside it, rather than |
| 211 | 211 | erasing and incorrect entry. |
| @@ -216,12 +216,12 @@ | ||
| 216 | 216 | The lack of a "rebase" command and the inability to rewrite history |
| 217 | 217 | is considered a feature of Fossil, not an omission or bug. |
| 218 | 218 | |
| 219 | 219 | <h3>3.9 License</h3> |
| 220 | 220 | |
| 221 | -Both Git and Fossil are open-source. Git is under | |
| 221 | +Both Git and Fossil are open-source. Git is under | |
| 222 | 222 | [http://www.gnu.org/licenses/gpl.html | GPL] whereas Fossil is |
| 223 | -under the | |
| 223 | +under the | |
| 224 | 224 | [http://en.wikipedia.org/wiki/BSD_licenses | two-clause BSD license]. |
| 225 | 225 | The difference should not be of a concern to most users. However, |
| 226 | 226 | some corporate lawyers have objections to using GPL products and |
| 227 | 227 | are more comfortable with a BSD-style license. |
| 228 | 228 |
| --- www/fossil-v-git.wiki | |
| +++ www/fossil-v-git.wiki | |
| @@ -3,15 +3,15 @@ | |
| 3 | <h2>1.0 Don't Stress!</h2> |
| 4 | |
| 5 | If you start out using one DVCS and later decide you like the other better, |
| 6 | it is [./inout.wiki | easy to change]. |
| 7 | |
| 8 | But it also helps to be informed about the differences between |
| 9 | [http://git-scm.com | Git] and Fossil. See the table below for |
| 10 | a high-level summary and the text that follows for more details. |
| 11 | |
| 12 | Keep in mind that you are reading this on a Fossil website, |
| 13 | so the information here |
| 14 | might be biased in favor of Fossil. Ask around with people who have |
| 15 | used both Fossil and Git for other opinions. |
| 16 | |
| 17 | <h2>2.0 Executive Summary:</h2> |
| @@ -47,21 +47,21 @@ | |
| 47 | <h3>3.2 Sharding versus Replicating</h3> |
| 48 | |
| 49 | Git makes it easy for each repository in a project to hold a subset of |
| 50 | the branches for that project. In fact, it is entirely possible and not |
| 51 | uncommon for no repository in the project to hold all the different code |
| 52 | versions for a project. Instead the information is distributed. |
| 53 | Individual developers have one or more private branches. A hierarchy |
| 54 | of integrators merge changes from individual developers into collaborative |
| 55 | branches, until all the changes are merged together at the top-level master |
| 56 | branch. And all of this can be accomplished without having to have all the |
| 57 | code in any one repository. Developers or groups of developers can share |
| 58 | only those branches that they want to share and keep other branchs of the |
| 59 | project private. This is analogous to sharding an a distributed database. |
| 60 | |
| 61 | Fossil allows private branches, but its default mode is to share everything. |
| 62 | And so in a Fossil project, all respositories tend to contain all of the |
| 63 | content at all times. This is analogous to replication in a |
| 64 | distributed database. |
| 65 | |
| 66 | The Git model works best for large projects, like the |
| 67 | Linux kernel for which Git was designed. |
| @@ -73,35 +73,35 @@ | |
| 73 | works in his or her own branch and then merges changes up the hierarchy |
| 74 | until they reach the master branch. |
| 75 | |
| 76 | Fossil is designed for smaller and non-hierarchical teams where all |
| 77 | developers are operating directly on the master branch, or at most |
| 78 | a small number of well defined branches. |
| 79 | The [./concepts.wiki#workflow | autosync] mode of Fossil makes it easy |
| 80 | for multiple developers to work on a single branch and maintain |
| 81 | linear development on that branch and avoid needless forking |
| 82 | and merging. |
| 83 | |
| 84 | <h3>3.3 Branches</h3> |
| 85 | |
| 86 | Git (and especially GitHub) encourages a workflow where each developer |
| 87 | has his or her own branch or branches. Developers then send "pull requests" |
| 88 | to have their changes be merged into "official" branches by integrators. |
| 89 | For example, the Linux kernel team has a hierarchy of integrators with |
| 90 | Linus Torvalds at the root. Individual developers each have their own |
| 91 | private branches of the source tree into which they make their own changes. |
| 92 | They then encourage first-tier integrators to pull those changes. The |
| 93 | first-tier integrators merge together changes from multiple contributors |
| 94 | then try to get second-tier integrators to pull their branches. The |
| 95 | changes merge up the hierarchy until (hopefully) they are pulled into |
| 96 | "Linus's branch", at which time they become part of the "official" Linux. |
| 97 | |
| 98 | In Git, each branch is "owned" by the person who creates it and works |
| 99 | on it. The owner might pull changes from others, but the owner is always |
| 100 | in control of the branch. Branches are developer-centric. |
| 101 | |
| 102 | Fossil, on the other hand, encourages a workflow where branches are |
| 103 | associated with features or releases, not individual developers. |
| 104 | All developers share all branches in common, and two |
| 105 | or more developers can and often do intersperse commits onto the same branch. |
| 106 | Branches do not belong to individuals. All branches are read/write |
| 107 | accessible to all developers at all times. There is no need |
| @@ -113,11 +113,11 @@ | |
| 113 | branches in Fossil are feature-centric. |
| 114 | |
| 115 | The Git approach scales much better for large projects like the Linux |
| 116 | kernel with thousands of contributors who in many cases don't even know |
| 117 | each others names. The integrators serve a gatekeeper role to help keep |
| 118 | undesirable code out of the official Linux source tree. On the other hand, |
| 119 | not many projects are as big or as loosely organized as the Linux kernel. |
| 120 | Most projects have a small team of developers who all know each other |
| 121 | well and trust each other, and who enjoy working together collaboratively |
| 122 | without the overhead and hierarchy of integrators. |
| 123 | |
| @@ -141,14 +141,14 @@ | |
| 141 | to think about version control to some extent. But one wants to minimize |
| 142 | the thinking about version control. |
| 143 | |
| 144 | Git requires the developer to maintain a more complex mental model than |
| 145 | most other DVCSes. Git takes longer to learn. And you have to spend |
| 146 | more time thinking about what you are doing with Git. |
| 147 | |
| 148 | Fossil strives for simplicity. Fossil wants to be easy to learn and to |
| 149 | require little thinking about how to operating it. |
| 150 | [./quotes.wiki | Reports from the field] |
| 151 | indicate that Fossil is mostly successful at this effort. |
| 152 | |
| 153 | <h3>3.5 Web Interface</h3> |
| 154 | |
| @@ -195,17 +195,17 @@ | |
| 195 | |
| 196 | Git features the "rebase" command which can be used to change the |
| 197 | sequence of check-ins in the repository. Rebase can be used to "clean up" |
| 198 | a complex sequence of check-ins to make their intent easier for others |
| 199 | to understand. This is important if you view the history of a project |
| 200 | as part of the documentation for the project. |
| 201 | |
| 202 | Fossil takes an opposing view. Fossil views history as sacrosanct and |
| 203 | stubornly refuses to change it. |
| 204 | Fossil allows mistakes to be corrected (for example, check-in comments |
| 205 | can be revised, and check-ins can be moved onto new branches even after |
| 206 | the check-in has occurred) but the correction is an addition to the respository |
| 207 | and the original actions are preserved and displayed alongside |
| 208 | the corrections, thus preserving an historically accurate audit trail. |
| 209 | This is analogous to an accountant marking through an incorrect |
| 210 | entry in a ledger and writing in a correction beside it, rather than |
| 211 | erasing and incorrect entry. |
| @@ -216,12 +216,12 @@ | |
| 216 | The lack of a "rebase" command and the inability to rewrite history |
| 217 | is considered a feature of Fossil, not an omission or bug. |
| 218 | |
| 219 | <h3>3.9 License</h3> |
| 220 | |
| 221 | Both Git and Fossil are open-source. Git is under |
| 222 | [http://www.gnu.org/licenses/gpl.html | GPL] whereas Fossil is |
| 223 | under the |
| 224 | [http://en.wikipedia.org/wiki/BSD_licenses | two-clause BSD license]. |
| 225 | The difference should not be of a concern to most users. However, |
| 226 | some corporate lawyers have objections to using GPL products and |
| 227 | are more comfortable with a BSD-style license. |
| 228 |
| --- www/fossil-v-git.wiki | |
| +++ www/fossil-v-git.wiki | |
| @@ -3,15 +3,15 @@ | |
| 3 | <h2>1.0 Don't Stress!</h2> |
| 4 | |
| 5 | If you start out using one DVCS and later decide you like the other better, |
| 6 | it is [./inout.wiki | easy to change]. |
| 7 | |
| 8 | But it also helps to be informed about the differences between |
| 9 | [http://git-scm.com | Git] and Fossil. See the table below for |
| 10 | a high-level summary and the text that follows for more details. |
| 11 | |
| 12 | Keep in mind that you are reading this on a Fossil website, |
| 13 | so the information here |
| 14 | might be biased in favor of Fossil. Ask around with people who have |
| 15 | used both Fossil and Git for other opinions. |
| 16 | |
| 17 | <h2>2.0 Executive Summary:</h2> |
| @@ -47,21 +47,21 @@ | |
| 47 | <h3>3.2 Sharding versus Replicating</h3> |
| 48 | |
| 49 | Git makes it easy for each repository in a project to hold a subset of |
| 50 | the branches for that project. In fact, it is entirely possible and not |
| 51 | uncommon for no repository in the project to hold all the different code |
| 52 | versions for a project. Instead the information is distributed. |
| 53 | Individual developers have one or more private branches. A hierarchy |
| 54 | of integrators merge changes from individual developers into collaborative |
| 55 | branches, until all the changes are merged together at the top-level master |
| 56 | branch. And all of this can be accomplished without having to have all the |
| 57 | code in any one repository. Developers or groups of developers can share |
| 58 | only those branches that they want to share and keep other branchs of the |
| 59 | project private. This is analogous to sharding an a distributed database. |
| 60 | |
| 61 | Fossil allows private branches, but its default mode is to share everything. |
| 62 | And so in a Fossil project, all repositories tend to contain all of the |
| 63 | content at all times. This is analogous to replication in a |
| 64 | distributed database. |
| 65 | |
| 66 | The Git model works best for large projects, like the |
| 67 | Linux kernel for which Git was designed. |
| @@ -73,35 +73,35 @@ | |
| 73 | works in his or her own branch and then merges changes up the hierarchy |
| 74 | until they reach the master branch. |
| 75 | |
| 76 | Fossil is designed for smaller and non-hierarchical teams where all |
| 77 | developers are operating directly on the master branch, or at most |
| 78 | a small number of well defined branches. |
| 79 | The [./concepts.wiki#workflow | autosync] mode of Fossil makes it easy |
| 80 | for multiple developers to work on a single branch and maintain |
| 81 | linear development on that branch and avoid needless forking |
| 82 | and merging. |
| 83 | |
| 84 | <h3>3.3 Branches</h3> |
| 85 | |
| 86 | Git (and especially GitHub) encourages a workflow where each developer |
| 87 | has his or her own branch or branches. Developers then send "pull requests" |
| 88 | to have their changes be merged into "official" branches by integrators. |
| 89 | For example, the Linux kernel team has a hierarchy of integrators with |
| 90 | Linus Torvalds at the root. Individual developers each have their own |
| 91 | private branches of the source tree into which they make their own changes. |
| 92 | They then encourage first-tier integrators to pull those changes. The |
| 93 | first-tier integrators merge together changes from multiple contributors |
| 94 | then try to get second-tier integrators to pull their branches. The |
| 95 | changes merge up the hierarchy until (hopefully) they are pulled into |
| 96 | "Linus's branch", at which time they become part of the "official" Linux. |
| 97 | |
| 98 | In Git, each branch is "owned" by the person who creates it and works |
| 99 | on it. The owner might pull changes from others, but the owner is always |
| 100 | in control of the branch. Branches are developer-centric. |
| 101 | |
| 102 | Fossil, on the other hand, encourages a workflow where branches are |
| 103 | associated with features or releases, not individual developers. |
| 104 | All developers share all branches in common, and two |
| 105 | or more developers can and often do intersperse commits onto the same branch. |
| 106 | Branches do not belong to individuals. All branches are read/write |
| 107 | accessible to all developers at all times. There is no need |
| @@ -113,11 +113,11 @@ | |
| 113 | branches in Fossil are feature-centric. |
| 114 | |
| 115 | The Git approach scales much better for large projects like the Linux |
| 116 | kernel with thousands of contributors who in many cases don't even know |
| 117 | each others names. The integrators serve a gatekeeper role to help keep |
| 118 | undesirable code out of the official Linux source tree. On the other hand, |
| 119 | not many projects are as big or as loosely organized as the Linux kernel. |
| 120 | Most projects have a small team of developers who all know each other |
| 121 | well and trust each other, and who enjoy working together collaboratively |
| 122 | without the overhead and hierarchy of integrators. |
| 123 | |
| @@ -141,14 +141,14 @@ | |
| 141 | to think about version control to some extent. But one wants to minimize |
| 142 | the thinking about version control. |
| 143 | |
| 144 | Git requires the developer to maintain a more complex mental model than |
| 145 | most other DVCSes. Git takes longer to learn. And you have to spend |
| 146 | more time thinking about what you are doing with Git. |
| 147 | |
| 148 | Fossil strives for simplicity. Fossil wants to be easy to learn and to |
| 149 | require little thinking about how to operating it. |
| 150 | [./quotes.wiki | Reports from the field] |
| 151 | indicate that Fossil is mostly successful at this effort. |
| 152 | |
| 153 | <h3>3.5 Web Interface</h3> |
| 154 | |
| @@ -195,17 +195,17 @@ | |
| 195 | |
| 196 | Git features the "rebase" command which can be used to change the |
| 197 | sequence of check-ins in the repository. Rebase can be used to "clean up" |
| 198 | a complex sequence of check-ins to make their intent easier for others |
| 199 | to understand. This is important if you view the history of a project |
| 200 | as part of the documentation for the project. |
| 201 | |
| 202 | Fossil takes an opposing view. Fossil views history as sacrosanct and |
| 203 | stubornly refuses to change it. |
| 204 | Fossil allows mistakes to be corrected (for example, check-in comments |
| 205 | can be revised, and check-ins can be moved onto new branches even after |
| 206 | the check-in has occurred) but the correction is an addition to the repository |
| 207 | and the original actions are preserved and displayed alongside |
| 208 | the corrections, thus preserving an historically accurate audit trail. |
| 209 | This is analogous to an accountant marking through an incorrect |
| 210 | entry in a ledger and writing in a correction beside it, rather than |
| 211 | erasing and incorrect entry. |
| @@ -216,12 +216,12 @@ | |
| 216 | The lack of a "rebase" command and the inability to rewrite history |
| 217 | is considered a feature of Fossil, not an omission or bug. |
| 218 | |
| 219 | <h3>3.9 License</h3> |
| 220 | |
| 221 | Both Git and Fossil are open-source. Git is under |
| 222 | [http://www.gnu.org/licenses/gpl.html | GPL] whereas Fossil is |
| 223 | under the |
| 224 | [http://en.wikipedia.org/wiki/BSD_licenses | two-clause BSD license]. |
| 225 | The difference should not be of a concern to most users. However, |
| 226 | some corporate lawyers have objections to using GPL products and |
| 227 | are more comfortable with a BSD-style license. |
| 228 |
+8
-8
| --- www/password.wiki | ||
| +++ www/password.wiki | ||
| @@ -7,12 +7,12 @@ | ||
| 7 | 7 | are not transmitted from one repository to another during a sync. |
| 8 | 8 | Passwords are local configuration information that can (and usually does) |
| 9 | 9 | vary from one repository to the next within the same project. |
| 10 | 10 | |
| 11 | 11 | Passwords are stored in the PW field of the USER table. |
| 12 | -In older versions of Fossil (prior to | |
| 13 | -[/timeline?c=2010-01-10+20:56:30 | 2010-01-11]) the password | |
| 12 | +In older versions of Fossil (prior to | |
| 13 | +[/timeline?c=2010-01-10T20:56:30 | 2010-01-11]) the password | |
| 14 | 14 | is stored as cleartext. In newer versions of Fossil, the password |
| 15 | 15 | can be either cleartext or an SHA1 hash (written as a 40-character |
| 16 | 16 | lower-case hexadecimal number). If the USER.PW field contains |
| 17 | 17 | a 40-character string, that string is assumed to be a SHA1 hash. |
| 18 | 18 | If the size of USER.PW is anything other than 40 characters, then |
| @@ -71,14 +71,14 @@ | ||
| 71 | 71 | hashes the password and compares it against the value stored in USER.PW. |
| 72 | 72 | If they match, the server sets a cookie on the client to record the |
| 73 | 73 | login. This cookie contains a large amount of high-quality randomness |
| 74 | 74 | and is thus intractable to guess. The value of the cookie and the IP |
| 75 | 75 | address of the client is stored in the USER.COOKIE and USER.IPADDR fields |
| 76 | -of the USER table on the server. | |
| 76 | +of the USER table on the server. | |
| 77 | 77 | The USER.CEXPIRE field holds an expiration date |
| 78 | 78 | for the cookie, encoded as a julian day number. On all subsequent |
| 79 | -HTTP requests, the cookie value is matched against the USER table to | |
| 79 | +HTTP requests, the cookie value is matched against the USER table to | |
| 80 | 80 | enable access to the repository. |
| 81 | 81 | |
| 82 | 82 | A login cookie will only work if the IP address matches. This feature |
| 83 | 83 | is designed to make it more difficult for an attacker to sniff the cookie |
| 84 | 84 | and take over the connection. A cookie-sniffing attack will only work |
| @@ -103,12 +103,12 @@ | ||
| 103 | 103 | over the wire, but that plan has not yet been set in code. |
| 104 | 104 | |
| 105 | 105 | <h2>Sync Protocol Authentication</h2> |
| 106 | 106 | |
| 107 | 107 | A different authentication mechanism is used when one repository wants |
| 108 | -to sync (or push or pull or clone) another respository. When two | |
| 109 | -respositories are syncing, the one that initiates the transaction is | |
| 108 | +to sync (or push or pull or clone) another repository. When two | |
| 109 | +repositories are syncing, the one that initiates the transaction is | |
| 110 | 110 | the client and the repository that responds is the server. The client |
| 111 | 111 | works by sending HTTP requests to the server with a method of "xfer" |
| 112 | 112 | and a content-type of "application/x-fossil". The content is Zlib-compressed |
| 113 | 113 | text consisting of "cards" of instructions. The first card of this content |
| 114 | 114 | is a "login" card responsible for authentication. The login card contains |
| @@ -137,12 +137,12 @@ | ||
| 137 | 137 | <blockquote><pre> |
| 138 | 138 | http://<font color="blue">login:password</font>@servername.org/path |
| 139 | 139 | </pre></blockquote> |
| 140 | 140 | |
| 141 | 141 | For older clients, the password is used for the shared secret as stated |
| 142 | -in the URL and with no encoding. | |
| 143 | -For newer clients, the shared secret is derived from the password | |
| 142 | +in the URL and with no encoding. | |
| 143 | +For newer clients, the shared secret is derived from the password | |
| 144 | 144 | by transformed the password using the SHA1 hash encoding |
| 145 | 145 | described above. However, if the first character of the password is |
| 146 | 146 | "*" (ASCII 0x2a) then the "*" is skipped and the rest of the password |
| 147 | 147 | is used directly as the share secret without the SHA1 encoding. |
| 148 | 148 | |
| 149 | 149 |
| --- www/password.wiki | |
| +++ www/password.wiki | |
| @@ -7,12 +7,12 @@ | |
| 7 | are not transmitted from one repository to another during a sync. |
| 8 | Passwords are local configuration information that can (and usually does) |
| 9 | vary from one repository to the next within the same project. |
| 10 | |
| 11 | Passwords are stored in the PW field of the USER table. |
| 12 | In older versions of Fossil (prior to |
| 13 | [/timeline?c=2010-01-10+20:56:30 | 2010-01-11]) the password |
| 14 | is stored as cleartext. In newer versions of Fossil, the password |
| 15 | can be either cleartext or an SHA1 hash (written as a 40-character |
| 16 | lower-case hexadecimal number). If the USER.PW field contains |
| 17 | a 40-character string, that string is assumed to be a SHA1 hash. |
| 18 | If the size of USER.PW is anything other than 40 characters, then |
| @@ -71,14 +71,14 @@ | |
| 71 | hashes the password and compares it against the value stored in USER.PW. |
| 72 | If they match, the server sets a cookie on the client to record the |
| 73 | login. This cookie contains a large amount of high-quality randomness |
| 74 | and is thus intractable to guess. The value of the cookie and the IP |
| 75 | address of the client is stored in the USER.COOKIE and USER.IPADDR fields |
| 76 | of the USER table on the server. |
| 77 | The USER.CEXPIRE field holds an expiration date |
| 78 | for the cookie, encoded as a julian day number. On all subsequent |
| 79 | HTTP requests, the cookie value is matched against the USER table to |
| 80 | enable access to the repository. |
| 81 | |
| 82 | A login cookie will only work if the IP address matches. This feature |
| 83 | is designed to make it more difficult for an attacker to sniff the cookie |
| 84 | and take over the connection. A cookie-sniffing attack will only work |
| @@ -103,12 +103,12 @@ | |
| 103 | over the wire, but that plan has not yet been set in code. |
| 104 | |
| 105 | <h2>Sync Protocol Authentication</h2> |
| 106 | |
| 107 | A different authentication mechanism is used when one repository wants |
| 108 | to sync (or push or pull or clone) another respository. When two |
| 109 | respositories are syncing, the one that initiates the transaction is |
| 110 | the client and the repository that responds is the server. The client |
| 111 | works by sending HTTP requests to the server with a method of "xfer" |
| 112 | and a content-type of "application/x-fossil". The content is Zlib-compressed |
| 113 | text consisting of "cards" of instructions. The first card of this content |
| 114 | is a "login" card responsible for authentication. The login card contains |
| @@ -137,12 +137,12 @@ | |
| 137 | <blockquote><pre> |
| 138 | http://<font color="blue">login:password</font>@servername.org/path |
| 139 | </pre></blockquote> |
| 140 | |
| 141 | For older clients, the password is used for the shared secret as stated |
| 142 | in the URL and with no encoding. |
| 143 | For newer clients, the shared secret is derived from the password |
| 144 | by transformed the password using the SHA1 hash encoding |
| 145 | described above. However, if the first character of the password is |
| 146 | "*" (ASCII 0x2a) then the "*" is skipped and the rest of the password |
| 147 | is used directly as the share secret without the SHA1 encoding. |
| 148 | |
| 149 |
| --- www/password.wiki | |
| +++ www/password.wiki | |
| @@ -7,12 +7,12 @@ | |
| 7 | are not transmitted from one repository to another during a sync. |
| 8 | Passwords are local configuration information that can (and usually does) |
| 9 | vary from one repository to the next within the same project. |
| 10 | |
| 11 | Passwords are stored in the PW field of the USER table. |
| 12 | In older versions of Fossil (prior to |
| 13 | [/timeline?c=2010-01-10T20:56:30 | 2010-01-11]) the password |
| 14 | is stored as cleartext. In newer versions of Fossil, the password |
| 15 | can be either cleartext or an SHA1 hash (written as a 40-character |
| 16 | lower-case hexadecimal number). If the USER.PW field contains |
| 17 | a 40-character string, that string is assumed to be a SHA1 hash. |
| 18 | If the size of USER.PW is anything other than 40 characters, then |
| @@ -71,14 +71,14 @@ | |
| 71 | hashes the password and compares it against the value stored in USER.PW. |
| 72 | If they match, the server sets a cookie on the client to record the |
| 73 | login. This cookie contains a large amount of high-quality randomness |
| 74 | and is thus intractable to guess. The value of the cookie and the IP |
| 75 | address of the client is stored in the USER.COOKIE and USER.IPADDR fields |
| 76 | of the USER table on the server. |
| 77 | The USER.CEXPIRE field holds an expiration date |
| 78 | for the cookie, encoded as a julian day number. On all subsequent |
| 79 | HTTP requests, the cookie value is matched against the USER table to |
| 80 | enable access to the repository. |
| 81 | |
| 82 | A login cookie will only work if the IP address matches. This feature |
| 83 | is designed to make it more difficult for an attacker to sniff the cookie |
| 84 | and take over the connection. A cookie-sniffing attack will only work |
| @@ -103,12 +103,12 @@ | |
| 103 | over the wire, but that plan has not yet been set in code. |
| 104 | |
| 105 | <h2>Sync Protocol Authentication</h2> |
| 106 | |
| 107 | A different authentication mechanism is used when one repository wants |
| 108 | to sync (or push or pull or clone) another repository. When two |
| 109 | repositories are syncing, the one that initiates the transaction is |
| 110 | the client and the repository that responds is the server. The client |
| 111 | works by sending HTTP requests to the server with a method of "xfer" |
| 112 | and a content-type of "application/x-fossil". The content is Zlib-compressed |
| 113 | text consisting of "cards" of instructions. The first card of this content |
| 114 | is a "login" card responsible for authentication. The login card contains |
| @@ -137,12 +137,12 @@ | |
| 137 | <blockquote><pre> |
| 138 | http://<font color="blue">login:password</font>@servername.org/path |
| 139 | </pre></blockquote> |
| 140 | |
| 141 | For older clients, the password is used for the shared secret as stated |
| 142 | in the URL and with no encoding. |
| 143 | For newer clients, the shared secret is derived from the password |
| 144 | by transformed the password using the SHA1 hash encoding |
| 145 | described above. However, if the first character of the password is |
| 146 | "*" (ASCII 0x2a) then the "*" is skipped and the rest of the password |
| 147 | is used directly as the share secret without the SHA1 encoding. |
| 148 | |
| 149 |
+1
-1
| --- www/shunning.wiki | ||
| +++ www/shunning.wiki | ||
| @@ -42,11 +42,11 @@ | ||
| 42 | 42 | the shunning list does not propagate is a security feature. If the |
| 43 | 43 | shunning list propagated then a malicious user (or |
| 44 | 44 | a bug in the fossil code) might introduce a shun record that would |
| 45 | 45 | propagate through all repositories in a network and permanently |
| 46 | 46 | destroy vital information. By refusing to propagate the shunning list, |
| 47 | -Fossil insures that no remote user will ever be able to remove | |
| 47 | +Fossil ensures that no remote user will ever be able to remove | |
| 48 | 48 | information from your personal repositories without your permission. |
| 49 | 49 | |
| 50 | 50 | The shunning list does not propagate to a remote repository |
| 51 | 51 | by the normal "sync" mechanism, |
| 52 | 52 | but it is still possible to copy shuns from one repository to another |
| 53 | 53 |
| --- www/shunning.wiki | |
| +++ www/shunning.wiki | |
| @@ -42,11 +42,11 @@ | |
| 42 | the shunning list does not propagate is a security feature. If the |
| 43 | shunning list propagated then a malicious user (or |
| 44 | a bug in the fossil code) might introduce a shun record that would |
| 45 | propagate through all repositories in a network and permanently |
| 46 | destroy vital information. By refusing to propagate the shunning list, |
| 47 | Fossil insures that no remote user will ever be able to remove |
| 48 | information from your personal repositories without your permission. |
| 49 | |
| 50 | The shunning list does not propagate to a remote repository |
| 51 | by the normal "sync" mechanism, |
| 52 | but it is still possible to copy shuns from one repository to another |
| 53 |
| --- www/shunning.wiki | |
| +++ www/shunning.wiki | |
| @@ -42,11 +42,11 @@ | |
| 42 | the shunning list does not propagate is a security feature. If the |
| 43 | shunning list propagated then a malicious user (or |
| 44 | a bug in the fossil code) might introduce a shun record that would |
| 45 | propagate through all repositories in a network and permanently |
| 46 | destroy vital information. By refusing to propagate the shunning list, |
| 47 | Fossil ensures that no remote user will ever be able to remove |
| 48 | information from your personal repositories without your permission. |
| 49 | |
| 50 | The shunning list does not propagate to a remote repository |
| 51 | by the normal "sync" mechanism, |
| 52 | but it is still possible to copy shuns from one repository to another |
| 53 |
+7
-7
| --- www/tickets.wiki | ||
| +++ www/tickets.wiki | ||
| @@ -101,20 +101,20 @@ | ||
| 101 | 101 | used to uniquely identify the ticket to which the row belongs. These |
| 102 | 102 | keys are for internal use only and may change when doing a "fossil rebuild". |
| 103 | 103 | |
| 104 | 104 | The <b>tkt_uuid</b> field is the unique hexadecimal identifier for the ticket. |
| 105 | 105 | Ticket identifiers appear to be SHA1 hash strings, but they |
| 106 | -are not really the hash of any identifible artifact. They are | |
| 106 | +are not really the hash of any identifiable artifact. They are | |
| 107 | 107 | just random hexadecimal numbers. When creating a new ticket, Fossil uses |
| 108 | -a (high-quality) pseudo-random number generator to create the ticket | |
| 108 | +a (high-quality) pseudo-random number generator to create the ticket | |
| 109 | 109 | number. The ticket numbers are large so that the chance of collision |
| 110 | 110 | between any two tickets is vanishingly small. |
| 111 | 111 | |
| 112 | 112 | The <b>tkt_mtime</b> field of TICKET shows the time (as a Julian day number) |
| 113 | 113 | of the most recent ticket change artifact for that ticket. The |
| 114 | 114 | <b>tkt_mtime</b> field of TICKETCHNG shows the timestamp on the ticket |
| 115 | -change artifact that the TICKETCHNG row refers to. The | |
| 115 | +change artifact that the TICKETCHNG row refers to. The | |
| 116 | 116 | <b>tkt_ctime</b> field of TICKET is the time of the oldest ticket change |
| 117 | 117 | artifact for that ticket, thus holding the time that the ticket was |
| 118 | 118 | created. |
| 119 | 119 | |
| 120 | 120 | The <b>tkt_rid</b> field of TICKETCHNG is the integer primary key in the |
| @@ -160,11 +160,11 @@ | ||
| 160 | 160 | visited, its key/value pairs are examined. For any key/value pair in |
| 161 | 161 | which the key is the same as a field in the TICKET table, the value |
| 162 | 162 | of that pair either replaces or is appended to the previous value |
| 163 | 163 | of the corresponding field in the TICKET table. Whether a value is |
| 164 | 164 | replaced or appended is determined by markings in the ticket change |
| 165 | -artifact itself. Most fields are usually replaced. (For example, to change | |
| 165 | +artifact itself. Most fields are usually replaced. (For example, to change | |
| 166 | 166 | the status from "Open" to "Fixed" would involve a key value pair |
| 167 | 167 | "status/Fixed" with the replace attribute set). The main exception |
| 168 | 168 | is the "comment" field, which is usually appended with new comment |
| 169 | 169 | text. |
| 170 | 170 | |
| @@ -174,26 +174,26 @@ | ||
| 174 | 174 | difference there. |
| 175 | 175 | |
| 176 | 176 | <h3>2.3 Old-Style versus New-Style Tickets</h3> |
| 177 | 177 | |
| 178 | 178 | Older versions of Fossil |
| 179 | -(before [/timeline?c=2012-11-27+16:26:29 | 2012-11-27]) | |
| 179 | +(before [/timeline?c=2012-11-27T16:26:29 | 2012-11-27]) | |
| 180 | 180 | only supported the TICKET table. |
| 181 | 181 | In this older style, new comments were added to tickets by using |
| 182 | 182 | the append-value feature on the comment field. Thus the TICKET.COMMENT |
| 183 | 183 | field contains the complete text of all user comments already appended |
| 184 | 184 | together and ready for display. |
| 185 | 185 | |
| 186 | 186 | A problem with the old approach is that all comment text had to |
| 187 | 187 | be in the same format. In other words, the all comment text had to be |
| 188 | 188 | either plaintext or wiki or HTML. It was not possible for some comments |
| 189 | -to be in HTML and others to be plaintext. Some site adminstrators wanted the | |
| 190 | -ability to mix plaintext, wiki, and HTML comments and display each | |
| 189 | +to be in HTML and others to be plaintext. Some site administrators wanted the | |
| 190 | +ability to mix plaintext, wiki, and HTML comments and display each | |
| 191 | 191 | comment according to its chosen format. Hence, Fossil was enhanced to |
| 192 | 192 | support the "new-style" tickets. |
| 193 | 193 | |
| 194 | 194 | The TICKETCHNG table was added to support new-style tickets. In the new |
| 195 | 195 | style, comment text is stored with the "icomment" (for "Incremental Comment") |
| 196 | 196 | key and appears separately, and with its on mimetype, in multiple rows |
| 197 | 197 | of the TICKETCHNG table. It then falls to the TH1 script code on the |
| 198 | 198 | View Ticket Page to query the TICKETCHNG table and extract and format |
| 199 | 199 | the various comments in timestamp order. |
| 200 | 200 |
| --- www/tickets.wiki | |
| +++ www/tickets.wiki | |
| @@ -101,20 +101,20 @@ | |
| 101 | used to uniquely identify the ticket to which the row belongs. These |
| 102 | keys are for internal use only and may change when doing a "fossil rebuild". |
| 103 | |
| 104 | The <b>tkt_uuid</b> field is the unique hexadecimal identifier for the ticket. |
| 105 | Ticket identifiers appear to be SHA1 hash strings, but they |
| 106 | are not really the hash of any identifible artifact. They are |
| 107 | just random hexadecimal numbers. When creating a new ticket, Fossil uses |
| 108 | a (high-quality) pseudo-random number generator to create the ticket |
| 109 | number. The ticket numbers are large so that the chance of collision |
| 110 | between any two tickets is vanishingly small. |
| 111 | |
| 112 | The <b>tkt_mtime</b> field of TICKET shows the time (as a Julian day number) |
| 113 | of the most recent ticket change artifact for that ticket. The |
| 114 | <b>tkt_mtime</b> field of TICKETCHNG shows the timestamp on the ticket |
| 115 | change artifact that the TICKETCHNG row refers to. The |
| 116 | <b>tkt_ctime</b> field of TICKET is the time of the oldest ticket change |
| 117 | artifact for that ticket, thus holding the time that the ticket was |
| 118 | created. |
| 119 | |
| 120 | The <b>tkt_rid</b> field of TICKETCHNG is the integer primary key in the |
| @@ -160,11 +160,11 @@ | |
| 160 | visited, its key/value pairs are examined. For any key/value pair in |
| 161 | which the key is the same as a field in the TICKET table, the value |
| 162 | of that pair either replaces or is appended to the previous value |
| 163 | of the corresponding field in the TICKET table. Whether a value is |
| 164 | replaced or appended is determined by markings in the ticket change |
| 165 | artifact itself. Most fields are usually replaced. (For example, to change |
| 166 | the status from "Open" to "Fixed" would involve a key value pair |
| 167 | "status/Fixed" with the replace attribute set). The main exception |
| 168 | is the "comment" field, which is usually appended with new comment |
| 169 | text. |
| 170 | |
| @@ -174,26 +174,26 @@ | |
| 174 | difference there. |
| 175 | |
| 176 | <h3>2.3 Old-Style versus New-Style Tickets</h3> |
| 177 | |
| 178 | Older versions of Fossil |
| 179 | (before [/timeline?c=2012-11-27+16:26:29 | 2012-11-27]) |
| 180 | only supported the TICKET table. |
| 181 | In this older style, new comments were added to tickets by using |
| 182 | the append-value feature on the comment field. Thus the TICKET.COMMENT |
| 183 | field contains the complete text of all user comments already appended |
| 184 | together and ready for display. |
| 185 | |
| 186 | A problem with the old approach is that all comment text had to |
| 187 | be in the same format. In other words, the all comment text had to be |
| 188 | either plaintext or wiki or HTML. It was not possible for some comments |
| 189 | to be in HTML and others to be plaintext. Some site adminstrators wanted the |
| 190 | ability to mix plaintext, wiki, and HTML comments and display each |
| 191 | comment according to its chosen format. Hence, Fossil was enhanced to |
| 192 | support the "new-style" tickets. |
| 193 | |
| 194 | The TICKETCHNG table was added to support new-style tickets. In the new |
| 195 | style, comment text is stored with the "icomment" (for "Incremental Comment") |
| 196 | key and appears separately, and with its on mimetype, in multiple rows |
| 197 | of the TICKETCHNG table. It then falls to the TH1 script code on the |
| 198 | View Ticket Page to query the TICKETCHNG table and extract and format |
| 199 | the various comments in timestamp order. |
| 200 |
| --- www/tickets.wiki | |
| +++ www/tickets.wiki | |
| @@ -101,20 +101,20 @@ | |
| 101 | used to uniquely identify the ticket to which the row belongs. These |
| 102 | keys are for internal use only and may change when doing a "fossil rebuild". |
| 103 | |
| 104 | The <b>tkt_uuid</b> field is the unique hexadecimal identifier for the ticket. |
| 105 | Ticket identifiers appear to be SHA1 hash strings, but they |
| 106 | are not really the hash of any identifiable artifact. They are |
| 107 | just random hexadecimal numbers. When creating a new ticket, Fossil uses |
| 108 | a (high-quality) pseudo-random number generator to create the ticket |
| 109 | number. The ticket numbers are large so that the chance of collision |
| 110 | between any two tickets is vanishingly small. |
| 111 | |
| 112 | The <b>tkt_mtime</b> field of TICKET shows the time (as a Julian day number) |
| 113 | of the most recent ticket change artifact for that ticket. The |
| 114 | <b>tkt_mtime</b> field of TICKETCHNG shows the timestamp on the ticket |
| 115 | change artifact that the TICKETCHNG row refers to. The |
| 116 | <b>tkt_ctime</b> field of TICKET is the time of the oldest ticket change |
| 117 | artifact for that ticket, thus holding the time that the ticket was |
| 118 | created. |
| 119 | |
| 120 | The <b>tkt_rid</b> field of TICKETCHNG is the integer primary key in the |
| @@ -160,11 +160,11 @@ | |
| 160 | visited, its key/value pairs are examined. For any key/value pair in |
| 161 | which the key is the same as a field in the TICKET table, the value |
| 162 | of that pair either replaces or is appended to the previous value |
| 163 | of the corresponding field in the TICKET table. Whether a value is |
| 164 | replaced or appended is determined by markings in the ticket change |
| 165 | artifact itself. Most fields are usually replaced. (For example, to change |
| 166 | the status from "Open" to "Fixed" would involve a key value pair |
| 167 | "status/Fixed" with the replace attribute set). The main exception |
| 168 | is the "comment" field, which is usually appended with new comment |
| 169 | text. |
| 170 | |
| @@ -174,26 +174,26 @@ | |
| 174 | difference there. |
| 175 | |
| 176 | <h3>2.3 Old-Style versus New-Style Tickets</h3> |
| 177 | |
| 178 | Older versions of Fossil |
| 179 | (before [/timeline?c=2012-11-27T16:26:29 | 2012-11-27]) |
| 180 | only supported the TICKET table. |
| 181 | In this older style, new comments were added to tickets by using |
| 182 | the append-value feature on the comment field. Thus the TICKET.COMMENT |
| 183 | field contains the complete text of all user comments already appended |
| 184 | together and ready for display. |
| 185 | |
| 186 | A problem with the old approach is that all comment text had to |
| 187 | be in the same format. In other words, the all comment text had to be |
| 188 | either plaintext or wiki or HTML. It was not possible for some comments |
| 189 | to be in HTML and others to be plaintext. Some site administrators wanted the |
| 190 | ability to mix plaintext, wiki, and HTML comments and display each |
| 191 | comment according to its chosen format. Hence, Fossil was enhanced to |
| 192 | support the "new-style" tickets. |
| 193 | |
| 194 | The TICKETCHNG table was added to support new-style tickets. In the new |
| 195 | style, comment text is stored with the "icomment" (for "Incremental Comment") |
| 196 | key and appears separately, and with its on mimetype, in multiple rows |
| 197 | of the TICKETCHNG table. It then falls to the TH1 script code on the |
| 198 | View Ticket Page to query the TICKETCHNG table and extract and format |
| 199 | the various comments in timestamp order. |
| 200 |