| 1 |
<HTML> |
| 2 |
|
| 3 |
<HEAD> |
| 4 |
<TITLE>ACEDB source code documentation: version numbering</TITLE> |
| 5 |
|
| 6 |
<LINK rel=stylesheet type="text/css" |
| 7 |
href="./wdoc.css" |
| 8 |
title="Style sheet for wdoc developer documents"> |
| 9 |
|
| 10 |
</HEAD> |
| 11 |
|
| 12 |
<BODY> |
| 13 |
|
| 14 |
<H1>Programmers' guide to version numbering in ACEDB and its libraries</H1> |
| 15 |
|
| 16 |
The version package provides tools for providing version numbers |
| 17 |
for ACEDB itself and for the libraries that comprise an ACEDB application. |
| 18 |
This document describes the rationale for how this is done |
| 19 |
and shows how to use the version code/tools to get the ACEDB kernel version |
| 20 |
and how to provide version numbering in a library. |
| 21 |
|
| 22 |
<H3>Introduction</H3> |
| 23 |
At one time ACEDB had just one version number which was the kernel and |
| 24 |
database version rolled into one. This single number was used to represent the |
| 25 |
whole of acedb code and also the version of the databases. This number was |
| 26 |
also used in the production of public releases of the code as part of the |
| 27 |
file name of the tar file containing the code. In addition a single build date |
| 28 |
was kept for each ACEDB executable. |
| 29 |
<P> |
| 30 |
As ACEDB has been restructured into a |
| 31 |
set of stand alone libraries it has become necessary to introduce version |
| 32 |
numbers for the individual libraries as well as produce an overall version |
| 33 |
number for the benefit of the user. |
| 34 |
|
| 35 |
<H3>What version numbers are required ?</H3> |
| 36 |
The required versions are: |
| 37 |
<OL> |
| 38 |
<LI>The ACEDB kernel/database version |
| 39 |
<LI>The acedb library versions |
| 40 |
<LI>The application version |
| 41 |
<LI>The ACEDB public release version |
| 42 |
</OL> |
| 43 |
To take these in turn: |
| 44 |
|
| 45 |
<H5>The ACEDB kernel/database version</H5> |
| 46 |
ACEDB databases are backward compatible; new versions of database code can read current and |
| 47 |
older ACEDB databases, |
| 48 |
but old versions of database code <BOLD>cannot</BOLD> read newer ACEDB databases. This is usually |
| 49 |
because new basic tag types have been added to the database code and old code will not recognise |
| 50 |
these tags. This backwards compatibility is enforced by the use of version numbers that are held |
| 51 |
both in the database itself and in the database code. Each time a new database is created, it receives |
| 52 |
the version number of the database code that created it, the code can then check this number |
| 53 |
against its own internal number. |
| 54 |
|
| 55 |
<H5>The ACEDB library versions</H5> |
| 56 |
There are a number of libraries that make up the acedb code, each one needs to have a version which |
| 57 |
can be used for bug reporting and compatibility checking. |
| 58 |
|
| 59 |
<H5>The application version</H5> |
| 60 |
ACEDB applications are created from a number of ACEDB components and it's |
| 61 |
important to know when the application was built so that the level of the |
| 62 |
components can be identified. |
| 63 |
|
| 64 |
<H5>The ACEDB public release version</H5> |
| 65 |
When acedb is released publically the tar files containing |
| 66 |
fixed versions etc have a letter associated with them, this letter |
| 67 |
represents a global 'fix' level for the whole ACEDB package. |
| 68 |
<PRE> |
| 69 |
e.g. |
| 70 |
bin.hp.4_5c.tar.Z |
| 71 |
bin.irix5.4_5e.tar.Z |
| 72 |
bin.solaris.4_5e.tar.Z |
| 73 |
bin.sunos.4_5d.tar.Z |
| 74 |
bin.alpha.4_5e.tar.Z |
| 75 |
bin.linux.4_5e.tar.Z etc. etc. |
| 76 |
</PRE> |
| 77 |
|
| 78 |
<H3>How are these different version numbers organised ?</H3> |
| 79 |
It is very important that the user can see just one version number for the ACEDB package including |
| 80 |
database version, the ACEDB kernel and whatever application the user is executing. It is also |
| 81 |
important that the ACEDB kernel continues to use just one set of version numbers. The developer on |
| 82 |
the other hand requires more detail about the components that the application was built from. |
| 83 |
<P> |
| 84 |
This has been achieved by using the ACEDB kernel version/update as the version number that the user sees |
| 85 |
and the version number for public updates and the ACEDB kernel. Thus the public version number is the |
| 86 |
version number of the ACEDB kernel. Individual libraries on the other hand have an internal version |
| 87 |
which is normally only seen by developers. |
| 88 |
|
| 89 |
<H3>How/what version numbers displayed ?</H3> |
| 90 |
The ACEDB version and build date appears in the banner text displayed when |
| 91 |
an ACEDB application starts. This information is also displayed in the title of the main acedb |
| 92 |
window of Windowing applications and is reported along with the build date of the |
| 93 |
application in help and program status windows. |
| 94 |
This shows the user exactly which version of ACEDB they are using. |
| 95 |
|
| 96 |
<P> |
| 97 |
Every executable also has embedded in it strings which show the ACEDB version/build date |
| 98 |
and also the version/build date of any ACEDB package libraries used in |
| 99 |
the application. This information can be seen on a unix system using the |
| 100 |
<KBD><B>what</B></KBD> command, e.g. |
| 101 |
<PRE> |
| 102 |
<KBD> |
| 103 |
griffin[edgrif]45: what xace |
| 104 |
xace: |
| 105 |
------------------------------------------------------------------------ |
| 106 |
ACEDB Version 4.6e, compiled on: Dec 10 1998 10:32:47 |
| 107 |
Copyright (c): J Thierry-Mieg and R Durbin, 1998 |
| 108 |
|
| 109 |
This file contains the above Sanger Informatics Group library, |
| 110 |
written by Richard Durbin (Sanger Centre, UK) [email protected] |
| 111 |
Jean Thierry-Mieg (CRBM du CNRS, France) [email protected] |
| 112 |
Ed Griffiths (Sanger Centre, UK) [email protected] |
| 113 |
Fred Wobus (Sanger Centre, UK) [email protected] |
| 114 |
You may redistribute this software subject to the conditions in the |
| 115 |
accompanying copyright file. Anyone interested in obtaining an up to date |
| 116 |
version should contact one of the authors at the above email addresses. |
| 117 |
------------------------------------------------------------------------ |
| 118 |
|
| 119 |
|
| 120 |
-------------------------------------------------------------------------- |
| 121 |
Title/Version: Free library - 1.1.1 |
| 122 |
Compiled: Dec 9 1998 10:47:26 |
| 123 |
Description: Sanger Centre Informatics utilities library. |
| 124 |
Copyright (c): J Thierry-Mieg and R Durbin, 1998 |
| 125 |
|
| 126 |
This file contains the above Sanger Informatics Group library, |
| 127 |
written by Richard Durbin (Sanger Centre, UK) [email protected] |
| 128 |
Jean Thierry-Mieg (CRBM du CNRS, France) [email protected] |
| 129 |
Ed Griffiths (Sanger Centre, UK) [email protected] |
| 130 |
Fred Wobus (Sanger Centre, UK) [email protected] |
| 131 |
You may redistribute this software subject to the conditions in the |
| 132 |
accompanying copyright file. Anyone interested in obtaining an up to date |
| 133 |
version should contact one of the authors at the above email addresses. |
| 134 |
-------------------------------------------------------------------------- |
| 135 |
|
| 136 |
|
| 137 |
-------------------------------------------------------------------------- |
| 138 |
Title/Version: Graph library - 1.1.1 |
| 139 |
Compiled: Dec 9 1998 10:47:36 |
| 140 |
Description: Sanger Centre Informatics graph library for window control |
| 141 |
Copyright (c): J Thierry-Mieg and R Durbin, 1998 |
| 142 |
|
| 143 |
This file contains the above Sanger Informatics Group library, |
| 144 |
written by Richard Durbin (Sanger Centre, UK) [email protected] |
| 145 |
Jean Thierry-Mieg (CRBM du CNRS, France) [email protected] |
| 146 |
Ed Griffiths (Sanger Centre, UK) [email protected] |
| 147 |
Fred Wobus (Sanger Centre, UK) [email protected] |
| 148 |
You may redistribute this software subject to the conditions in the |
| 149 |
accompanying copyright file. Anyone interested in obtaining an up to date |
| 150 |
version should contact one of the authors at the above email addresses. |
| 151 |
-------------------------------------------------------------------------- |
| 152 |
</KBD> |
| 153 |
</PRE> |
| 154 |
Hence the user will see just one unified ACEDB version whereas the developer can get |
| 155 |
more detailed information about how the application was built. |
| 156 |
|
| 157 |
|
| 158 |
<H3>Interface to the ACEDB kernel version</H3> |
| 159 |
|
| 160 |
<H5>The interface</H5> |
| 161 |
The aceversion.c module holds the version of the ACEDB kernel, this includes: |
| 162 |
<DL> |
| 163 |
<DT>version: |
| 164 |
<DD>is an integer which will only be changed when |
| 165 |
a major, perhaps incompatible change is made to the database. |
| 166 |
<DT>release: |
| 167 |
<DD>is an integer which is changed each time a significant number of new |
| 168 |
functions are added, or there is a need to 'unify' bug fixes/new code. |
| 169 |
<DT>update: |
| 170 |
<DD>a single lower case letter which is changed each time a new update of acedb is released |
| 171 |
to the outside world. |
| 172 |
</DL> |
| 173 |
In addition aceversion.c contains the build date of the kernel, the date is recorded using |
| 174 |
the ANSI C macros __DATE__ and __TIME__. The makefile ensures that aceversion.c is recompiled |
| 175 |
each time the ACEDB kernel is rebuilt thus ensuring that aceversion.c contains the true build |
| 176 |
date of the kernel. |
| 177 |
|
| 178 |
<P> |
| 179 |
The interface, defined in aceversion.h allows each element of the version to be retrieved individually |
| 180 |
or provides compound strings: |
| 181 |
<DL> |
| 182 |
<DT>int aceGetVersion(void) |
| 183 |
<DD>Returns an integer which is the current version of acedb. |
| 184 |
<DT>int aceGetRelease(void) |
| 185 |
<DD>Returns an integer which is the current release of acedb. |
| 186 |
<DT>char *aceGetUpdate(void) |
| 187 |
<DD>Returns a single lower case letter which is the current update of acedb. |
| 188 |
<DT>char *aceGetLinkDate(void) |
| 189 |
<DD>Returns the link date of the executable in the form "Mon dd yyyy" |
| 190 |
<DT>char *aceGetVersionString(void) |
| 191 |
<DD>Returns a string of the form <CODE>"ACEDB Version <version>_<release><update>"</CODE> |
| 192 |
e.g. <CODE>"ACEDB Version 4_6d"</CODE> which is the full version/release/update of |
| 193 |
the ACEDB kernel and also the ACEDB package in general. |
| 194 |
<DT>char *aceGetLinkDateString(void) |
| 195 |
<DD>Returns a string of the form <CODE>"compiled on: __DATE__ __TIME__"</CODE> |
| 196 |
e.g. <CODE> "compiled on: Dec 3 1998 13:59:07"</CODE> which is the date the ACEDB kernel |
| 197 |
was last built on. |
| 198 |
</DL> |
| 199 |
|
| 200 |
<H5>Changing the ACEDB release dates/numbers</H5> |
| 201 |
The module aceversion.c contains a section which defines the ACECB version: |
| 202 |
<PRE> |
| 203 |
<CODE> |
| 204 |
#define ACEDB_VERSION 4 |
| 205 |
#define ACEDB_RELEASE 6 |
| 206 |
#define ACEDB_UPDATE "e" |
| 207 |
</CODE> |
| 208 |
</PRE> |
| 209 |
changing the version simply requires editting the file and updating these |
| 210 |
<CODE>#define</CODE> values, the makefile will then rebuild the ACEDB library |
| 211 |
with the new version information. |
| 212 |
|
| 213 |
<H3>Interface to the ACEDB library version utilities</H3> |
| 214 |
The library utilities can be found in version.h and provide utilities to embed |
| 215 |
version, build date and copyright information into the library code and also |
| 216 |
a predefined function that allows an application to return its build date. |
| 217 |
|
| 218 |
<P> |
| 219 |
The following rules should be followed for ACEDB applications and libraries: |
| 220 |
<DL> |
| 221 |
<DT>ACEDB applications |
| 222 |
<DD>each ACEDB application should include the UT_MAKE_GETCOMPILEDATEROUTINE |
| 223 |
macro in the same module as the main function, this module should be recompiled |
| 224 |
every time the application is rebuilt, so that ACEDB library routines can then |
| 225 |
query the routine defined by UT_MAKE_GETCOMPILEDATEROUTINE to find out the |
| 226 |
build date of the application: |
| 227 |
<PRE><CODE> |
| 228 |
UT_MAKE_GETCOMPILEDATEROUTINE() |
| 229 |
|
| 230 |
int main(int argc, char *argv[]) |
| 231 |
{ |
| 232 |
..... |
| 233 |
|
| 234 |
} |
| 235 |
</CODE></PRE> |
| 236 |
<DT>ACEDB libraries |
| 237 |
<DD>each ACEDB library should include the UT_COPYRIGHT_STRING |
| 238 |
macro in one of its modules, this module should be recompiled |
| 239 |
every time the library is rebuilt so that the build date of |
| 240 |
the library is correctly updated, e.g. |
| 241 |
<PRE><CODE> |
| 242 |
/* free package version and copyright string. */ |
| 243 |
/* */ |
| 244 |
#define FREE_TITLE "Free library" |
| 245 |
#define FREE_DESC "Sanger Centre Informatics utilities library." |
| 246 |
#define FREE_VERSION 1 |
| 247 |
#define FREE_RELEASE 1 |
| 248 |
#define FREE_UPDATE 1 |
| 249 |
#define FREE_VERSION_NUMBER UT_MAKE_VERSION_NUMBER(FREE_VERSION, FREE_RELEASE, FREE_UPDATE) |
| 250 |
|
| 251 |
UT_COPYRIGHT_STRING(FREE_TITLE, FREE_VERSION, FREE_RELEASE, FREE_UPDATE, FREE_DESC) |
| 252 |
</CODE></PRE> |
| 253 |
Note that <CODE>UT_MAKE_VERSION_NUMBER</CODE> will make a single integer value out of |
| 254 |
version, release and update that can be used to test library with a single comparison. |
| 255 |
</DL> |
| 256 |
|
| 257 |
</BODY> |
| 258 |
</HTML> |
| 259 |
|
| 260 |
|