Not logged in

Artifact 2930052aaad1bbbd4542e56880d579f33306e923:


0000: 48 61 63 6b 69 6e 67 20 6f 6e 20 7a 65 70 74 6f  Hacking on zepto
0010: 64 62 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  db.=============
0020: 3d 3d 3d 3d 3d 0a 0a 48 61 63 6b 69 6e 67 20 6f  =====..Hacking o
0030: 6e 20 7a 65 70 74 6f 64 62 20 69 73 20 73 74 72  n zeptodb is str
0040: 61 69 67 68 74 2d 66 6f 72 77 61 72 64 2c 20 68  aight-forward, h
0050: 6f 77 65 76 65 72 20 74 68 65 72 65 20 61 72 65  owever there are
0060: 20 61 20 66 65 77 20 73 74 65 70 73 0a 74 6f 20   a few steps.to 
0070: 67 65 74 20 75 70 20 61 6e 64 20 72 75 6e 6e 69  get up and runni
0080: 6e 67 2e 0a 0a 47 65 74 74 69 6e 67 20 74 68 65  ng...Getting the
0090: 20 63 6f 64 65 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   code.----------
00a0: 2d 2d 2d 2d 2d 2d 0a 0a 46 69 72 73 74 2c 20 79  ------..First, y
00b0: 6f 75 20 6d 75 73 74 20 63 6c 6f 6e 65 20 74 68  ou must clone th
00c0: 65 20 46 6f 73 73 69 6c 20 72 65 70 6f 73 69 74  e Fossil reposit
00d0: 6f 72 79 2e 20 55 6e 6c 69 6b 65 20 6f 74 68 65  ory. Unlike othe
00e0: 72 20 72 65 76 69 73 69 6f 6e 0a 63 6f 6e 74 72  r revision.contr
00f0: 6f 6c 20 73 79 73 74 65 6d 73 2c 20 77 69 74 68  ol systems, with
0100: 20 46 6f 73 73 69 6c 20 77 68 65 6e 20 79 6f 75   Fossil when you
0110: 20 66 69 72 73 74 20 63 6c 6f 6e 65 20 61 20 72   first clone a r
0120: 65 70 6f 73 69 74 6f 72 79 20 79 6f 75 20 65 6e  epository you en
0130: 64 0a 75 70 20 77 69 74 68 20 6a 75 73 74 20 61  d.up with just a
0140: 20 73 69 6e 67 6c 65 20 66 69 6c 65 2e 20 54 68   single file. Th
0150: 69 73 20 66 69 6c 65 20 69 73 20 73 69 6d 70 6c  is file is simpl
0160: 79 20 61 20 53 51 4c 69 74 65 20 64 61 74 61 62  y a SQLite datab
0170: 61 73 65 0a 63 6f 6e 74 61 69 6e 69 6e 67 20 61  ase.containing a
0180: 6c 6c 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69  ll the informati
0190: 6f 6e 20 66 6f 72 20 74 68 65 20 72 65 70 6f 73  on for the repos
01a0: 69 74 6f 72 79 2e 20 57 68 65 6e 20 79 6f 75 20  itory. When you 
01b0: 6f 70 65 6e 20 69 74 0a 77 69 74 68 20 74 68 65  open it.with the
01c0: 20 66 6f 73 73 69 6c 20 70 72 6f 67 72 61 6d 2c   fossil program,
01d0: 20 69 74 20 77 69 6c 6c 20 65 78 74 72 61 63 74   it will extract
01e0: 20 61 6c 6c 20 6f 66 20 74 68 65 20 70 72 6f 6a   all of the proj
01f0: 65 63 74 20 66 69 6c 65 73 2e 0a 0a 54 68 65 20  ect files...The 
0200: 63 6f 6d 6d 6f 6e 20 70 72 61 63 74 69 63 65 20  common practice 
0210: 69 73 20 74 6f 20 73 74 6f 72 65 20 61 6c 6c 20  is to store all 
0220: 6f 66 20 79 6f 75 72 20 66 6f 73 73 69 6c 20 72  of your fossil r
0230: 65 70 6f 73 69 74 6f 72 69 65 73 20 6f 6e 20 6f  epositories on o
0240: 6e 65 0a 64 69 72 65 63 74 6c 79 20 28 61 6c 6c  ne.directly (all
0250: 6f 77 69 6e 67 20 74 68 65 6d 20 74 6f 20 62 65  owing them to be
0260: 20 65 61 73 69 6c 79 20 62 61 63 6b 65 64 2d 75   easily backed-u
0270: 70 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 29 2e  p, for example).
0280: 20 53 6f 2c 0a 66 69 72 73 74 2c 20 64 6f 20 74   So,.first, do t
0290: 68 61 74 3a 0a 0a 20 20 20 20 24 20 6d 6b 64 69  hat:..    $ mkdi
02a0: 72 20 7e 2f 50 72 6f 6a 65 63 74 73 2f 66 6f 73  r ~/Projects/fos
02b0: 73 69 6c 73 0a 20 20 20 20 24 20 63 64 20 7e 2f  sils.    $ cd ~/
02c0: 50 72 6f 6a 65 63 74 73 2f 66 6f 73 73 69 6c 73  Projects/fossils
02d0: 0a 20 20 20 20 24 20 66 6f 73 73 69 6c 20 63 6c  .    $ fossil cl
02e0: 6f 6e 65 20 68 74 74 70 3a 2f 2f 7a 65 70 74 6f  one http://zepto
02f0: 64 62 2e 69 6e 76 65 72 67 6f 2e 6e 65 74 2f 66  db.invergo.net/f
0300: 6f 73 73 69 6c 20 7a 65 70 74 6f 64 62 2e 66 6f  ossil zeptodb.fo
0310: 73 73 69 6c 0a 20 20 20 20 0a 59 6f 75 20 6e 6f  ssil.    .You no
0320: 77 20 68 61 76 65 20 79 6f 75 72 20 6f 77 6e 20  w have your own 
0330: 63 6f 70 79 20 6f 66 20 74 68 65 20 7a 65 70 74  copy of the zept
0340: 6f 64 62 20 72 65 70 6f 73 69 74 6f 72 79 2e 20  odb repository. 
0350: 4e 65 78 74 2c 20 63 72 65 61 74 65 20 61 0a 64  Next, create a.d
0360: 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 79  irectory where y
0370: 6f 75 20 77 6f 75 6c 64 20 6c 69 6b 65 20 74 6f  ou would like to
0380: 20 65 78 74 72 61 63 74 20 74 68 65 20 63 6f 64   extract the cod
0390: 65 2e 20 4c 69 6b 65 20 6d 6f 73 74 20 72 65 76  e. Like most rev
03a0: 69 73 69 6f 6e 0a 63 6f 6e 74 72 6f 6c 20 73 79  ision.control sy
03b0: 73 74 65 6d 73 2c 20 62 75 74 20 75 6e 6c 69 6b  stems, but unlik
03c0: 65 2c 20 73 61 79 2c 20 67 69 74 2c 20 62 72 61  e, say, git, bra
03d0: 6e 63 68 65 73 20 61 72 65 20 6b 65 70 74 20 69  nches are kept i
03e0: 6e 20 73 65 70 61 72 61 74 65 0a 64 69 72 65 63  n separate.direc
03f0: 74 6f 72 69 65 73 2e 20 57 65 27 6c 6c 20 73 74  tories. We'll st
0400: 61 72 74 20 77 69 74 68 20 74 68 65 20 22 74 72  art with the "tr
0410: 75 6e 6b 22 20 62 72 61 6e 63 68 3a 0a 0a 20 20  unk" branch:..  
0420: 20 20 24 20 6d 6b 64 69 72 20 2d 70 20 7e 2f 50    $ mkdir -p ~/P
0430: 72 6f 6a 65 63 74 73 2f 7a 65 70 74 6f 64 62 2f  rojects/zeptodb/
0440: 74 72 75 6e 6b 0a 20 20 20 20 24 20 63 64 20 7e  trunk.    $ cd ~
0450: 2f 50 72 6f 6a 65 63 74 73 2f 7a 65 70 74 6f 64  /Projects/zeptod
0460: 62 2f 74 72 75 6e 6b 0a 20 20 20 20 24 20 66 6f  b/trunk.    $ fo
0470: 73 73 69 6c 20 6f 70 65 6e 20 7e 2f 50 72 6f 6a  ssil open ~/Proj
0480: 65 63 74 73 2f 66 6f 73 73 69 6c 73 2f 7a 65 70  ects/fossils/zep
0490: 74 6f 64 62 2e 66 6f 73 73 69 6c 0a 0a 54 68 61  todb.fossil..Tha
04a0: 74 27 73 20 61 6c 6c 20 74 68 65 72 65 20 69 73  t's all there is
04b0: 20 74 6f 20 69 74 21 20 59 6f 75 20 6e 6f 77 20   to it! You now 
04c0: 73 68 6f 75 6c 64 20 68 61 76 65 20 61 6c 6c 20  should have all 
04d0: 6f 66 20 74 68 65 20 7a 65 70 74 6f 64 62 0a 66  of the zeptodb.f
04e0: 69 6c 65 73 20 69 6e 20 79 6f 75 72 20 74 72 75  iles in your tru
04f0: 6e 6b 20 64 69 72 65 63 74 6f 72 79 2e 20 0a 0a  nk directory. ..
0500: 46 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61  For more informa
0510: 74 69 6f 6e 20 6f 6e 20 68 6f 77 20 74 6f 20 75  tion on how to u
0520: 73 65 20 46 6f 73 73 69 6c 2c 20 76 69 73 69 74  se Fossil, visit
0530: 20 69 74 73 20 77 65 62 73 69 74 65 20 5b 31 5d   its website [1]
0540: 2e 0a 0a 42 6f 6f 74 73 74 72 61 70 70 69 6e 67  ...Bootstrapping
0550: 20 74 68 65 20 63 6f 64 65 0a 2d 2d 2d 2d 2d 2d   the code.------
0560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0570: 0a 0a 7a 65 70 74 6f 64 62 20 6d 61 6b 65 73 20  ..zeptodb makes 
0580: 75 73 65 20 6f 66 20 73 6f 6d 65 20 68 61 6e 64  use of some hand
0590: 79 2c 20 61 6c 62 65 69 74 20 6e 6f 6e 2d 73 74  y, albeit non-st
05a0: 61 6e 64 61 72 64 20 65 78 74 65 6e 73 69 6f 6e  andard extension
05b0: 73 0a 70 72 6f 76 69 64 65 64 20 62 79 20 74 68  s.provided by th
05c0: 65 20 47 4e 55 20 43 20 6c 69 62 72 61 72 79 20  e GNU C library 
05d0: 5b 32 5d 2e 20 49 6e 20 6f 72 64 65 72 20 74 6f  [2]. In order to
05e0: 20 61 73 73 75 72 65 20 74 68 61 74 20 7a 65 70   assure that zep
05f0: 74 6f 64 62 0a 77 69 6c 6c 20 62 75 69 6c 64 20  todb.will build 
0600: 6f 6e 20 61 73 20 77 69 64 65 20 6f 66 20 61 20  on as wide of a 
0610: 72 61 6e 67 65 20 6f 66 20 73 79 73 74 65 6d 73  range of systems
0620: 20 61 73 20 70 6f 73 73 69 62 6c 65 2c 20 69 6e   as possible, in
0630: 63 6c 75 64 69 6e 67 0a 74 68 6f 73 65 20 74 68  cluding.those th
0640: 61 74 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 47  at do not have G
0650: 4e 55 20 6c 69 62 63 2c 20 73 6f 6d 65 20 70 6f  NU libc, some po
0660: 72 74 61 62 69 6c 69 74 79 20 6d 6f 64 75 6c 65  rtability module
0670: 73 20 66 72 6f 6d 20 67 6e 75 6c 69 62 0a 5b 33  s from gnulib.[3
0680: 5d 20 61 72 65 20 75 73 65 64 2e 20 54 68 65 73  ] are used. Thes
0690: 65 20 66 69 6c 65 73 20 61 72 65 20 6e 6f 74 20  e files are not 
06a0: 63 68 65 63 6b 65 64 20 69 6e 74 6f 20 74 68 65  checked into the
06b0: 20 46 6f 73 73 69 6c 20 72 65 70 6f 73 69 74 6f   Fossil reposito
06c0: 72 79 2c 0a 73 6f 20 74 68 65 79 20 6d 75 73 74  ry,.so they must
06d0: 20 66 69 72 73 74 20 62 65 20 66 65 74 63 68 65   first be fetche
06e0: 64 2e 20 4e 65 78 74 2c 20 61 20 60 63 6f 6e 66  d. Next, a `conf
06f0: 69 67 75 72 65 60 20 73 63 72 69 70 74 20 61 6e  igure` script an
0700: 64 0a 63 6f 6e 66 69 67 75 72 61 62 6c 65 20 4d  d.configurable M
0710: 61 6b 65 66 69 6c 65 73 20 6e 65 65 64 20 74 6f  akefiles need to
0720: 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 76 69   be generated vi
0730: 61 20 41 75 74 6f 63 6f 6e 66 20 61 6e 64 20 41  a Autoconf and A
0740: 75 74 6f 6d 61 6b 65 2c 0a 72 65 73 70 65 63 74  utomake,.respect
0750: 69 76 65 6c 79 2e 0a 0a 49 6e 20 6f 72 64 65 72  ively...In order
0760: 20 74 6f 20 73 69 6d 70 6c 69 66 79 20 74 68 69   to simplify thi
0770: 73 20 77 68 6f 6c 65 20 70 72 6f 63 65 73 73 2c  s whole process,
0780: 20 61 20 73 63 72 69 70 74 20 63 61 6c 6c 65 64   a script called
0790: 20 60 62 6f 6f 74 73 74 72 61 70 60 0a 69 73 20   `bootstrap`.is 
07a0: 70 72 6f 76 69 64 65 64 2e 20 52 75 6e 6e 69 6e  provided. Runnin
07b0: 67 20 74 68 69 73 20 73 63 72 69 70 74 20 77 69  g this script wi
07c0: 6c 6c 3a 0a 0a 31 2e 20 46 65 74 63 68 20 67 6e  ll:..1. Fetch gn
07d0: 75 6c 69 62 0a 32 2e 20 55 70 64 61 74 65 20 69  ulib.2. Update i
07e0: 74 73 65 6c 66 2c 20 69 66 20 6e 65 63 65 73 73  tself, if necess
07f0: 61 72 79 0a 33 2e 20 46 65 74 63 68 20 74 68 65  ary.3. Fetch the
0800: 20 61 70 70 72 6f 70 72 69 61 74 65 20 67 6e 75   appropriate gnu
0810: 6c 69 62 20 6d 6f 64 75 6c 65 73 0a 34 2e 20 52  lib modules.4. R
0820: 75 6e 20 61 75 74 6f 63 6f 6e 66 0a 35 2e 20 52  un autoconf.5. R
0830: 75 6e 20 61 75 74 6f 6d 61 6b 65 0a 0a 49 66 20  un automake..If 
0840: 79 6f 75 20 61 6c 72 65 61 64 79 20 68 61 76 65  you already have
0850: 20 67 6e 75 6c 69 62 20 73 6f 6d 65 77 68 65 72   gnulib somewher
0860: 65 20 6f 6e 20 79 6f 75 72 20 63 6f 6d 70 75 74  e on your comput
0870: 65 72 2c 20 79 6f 75 20 63 61 6e 20 70 61 73 73  er, you can pass
0880: 0a 60 62 6f 6f 74 73 74 72 61 70 60 20 74 68 65  .`bootstrap` the
0890: 20 60 2d 2d 67 6e 75 6c 69 62 2d 73 72 63 64 69   `--gnulib-srcdi
08a0: 72 60 20 6f 70 74 69 6f 6e 20 74 6f 20 73 70 65  r` option to spe
08b0: 63 69 66 79 20 69 74 73 20 6c 6f 63 61 74 69 6f  cify its locatio
08c0: 6e 20 73 6f 0a 79 6f 75 20 64 6f 6e 27 74 20 68  n so.you don't h
08d0: 61 76 65 20 74 6f 20 77 61 73 74 65 20 62 61 6e  ave to waste ban
08e0: 64 77 69 64 74 68 20 64 6f 77 6e 6c 6f 61 64 69  dwidth downloadi
08f0: 6e 67 20 69 74 20 61 67 61 69 6e 2e 0a 0a 4f 6e  ng it again...On
0900: 63 65 20 74 68 65 20 77 68 6f 6c 65 20 70 72 6f  ce the whole pro
0910: 63 65 73 73 20 69 73 20 66 69 6e 69 73 68 65 64  cess is finished
0920: 2c 20 79 6f 75 20 63 61 6e 20 66 69 6e 61 6c 6c  , you can finall
0930: 79 20 72 75 6e 20 60 63 6f 6e 66 69 67 75 72 65  y run `configure
0940: 60 0a 61 6e 64 20 74 68 65 6e 20 62 75 69 6c 64  `.and then build
0950: 20 74 68 65 20 63 6f 64 65 21 0a 0a 46 6f 6f 74   the code!..Foot
0960: 6e 6f 74 65 73 3a 20 0a 5b 31 5d 20 20 68 74 74  notes: .[1]  htt
0970: 70 3a 2f 2f 77 77 77 2e 66 6f 73 73 69 6c 2d 73  p://www.fossil-s
0980: 63 6d 2e 6f 72 67 0a 0a 5b 32 5d 20 20 68 74 74  cm.org..[2]  htt
0990: 70 3a 2f 2f 77 77 77 2e 67 6e 75 2e 6f 72 67 2f  p://www.gnu.org/
09a0: 73 6f 66 74 77 61 72 65 2f 6c 69 62 63 0a 0a 5b  software/libc..[
09b0: 33 5d 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 67  3]  http://www.g
09c0: 6e 75 2e 6f 72 67 2f 73 6f 66 74 77 61 72 65 2f  nu.org/software/
09d0: 67 6e 75 6c 69 62 0a 0a                          gnulib..