[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Move library version to svn_config.

From: Scott Lamb <slamb_at_slamb.org>
Date: 2002-08-07 01:26:11 CEST

Karl Fogel wrote:
> Yup. So we would make a separate SVN_VER_LIBRARY in svn_version.h,
> and parse it out for the build/install process, and also Scott's patch
> would use it?

[...]

> Scott, how would you feel about taking all of this on (i.e., extending
> your ra_loader patch to solve all of these problems)? Fine to say no,
> of course, just let us know so we can schedule it in that case.

Done. I haven't actually done a "make install" (no good machine handy)
but build-outputs.mk looks right and I can't imagine ra_loader.c being
wrong.

Question: why are the build.conf and build-outputs.mk filenames handled
the way they are? They're passed through several levels of Python code
but hardcoded in the end in gen-make.py or autogen.sh. I tried to match
it with the svn-version.h filename, but I confess I don't see the point.

--
Scott Lamb

Move library version near other version information and fix ra_loader.

* build.conf:
  Remove library version.

* subversion/include/svn_version.h:
  Add library version.

* build/gen_base.py:
  Extract library version from svn_version.h

* build/gen_make.py:
  Pass through svn_version filename.

* gen-make.py:
  Build svn_version.h filename.

* subversion/libsvn_ra/ra_loader.c:
  Use correct filename with library version component.

Index: ./build.conf
===================================================================
--- ./build.conf
+++ ./build.conf Tue Aug 6 16:58:17 2002
@@ -24,10 +24,6 @@
 # than defining build targets.
 #
 
-[options]
-# for use in (include) paths and library construction
-version = 1
-
 [includes]
 paths = subversion/include/*.h
 
Index: ./subversion/libsvn_ra/ra_loader.c
===================================================================
--- ./subversion/libsvn_ra/ra_loader.c
+++ ./subversion/libsvn_ra/ra_loader.c Tue Aug 6 17:00:53 2002
@@ -89,7 +89,8 @@
     apr_status_t status;
 
     /* ### fix the .so part */
- libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
+ libname = apr_psprintf (pool, "libsvn_ra_%s-%d.so",
+ ra_name, SVN_VER_LIBRARY);
     funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
 
     /* find/load the specified library */
Index: ./subversion/include/svn_version.h
===================================================================
--- ./subversion/include/svn_version.h
+++ ./subversion/include/svn_version.h Tue Aug 6 17:22:56 2002
@@ -49,6 +49,9 @@
    Modify for every released patch. */
 #define SVN_VER_MICRO 0
 
+/* Library version number. */
+#define SVN_VER_LIBRARY 1
+
 
 /* Version tag: a string describing the version.
    This tag remains "dev build" in the repository so that we can always
Index: ./build/gen_base.py
===================================================================
--- ./build/gen_base.py
+++ ./build/gen_base.py Tue Aug 6 17:17:58 2002
@@ -22,12 +22,21 @@
   # file-type is 'target', 'object', ...
   #
 
- def __init__(self, fname):
+ def __init__(self, fname, verfname):
     self.parser = ConfigParser.ConfigParser(_cfg_defaults)
     self.parser.read(fname)
 
     # extract some basic information
- self.version = self.parser.get('options', 'version')
+
+ # Version comes from a header file since it is used in the code.
+ versionre = re.compile('^#define SVN_VER_LIBRARY\s+(\d+)$')
+ for line in open(verfname, 'r').readlines():
+ match = versionre.match(line)
+ if not match is None:
+ self.version = match.group(1)
+ break
+ if match is None:
+ raise GenError('Unable to extract version.')
 
     self.targets = { }
     self.includes = [ ]
Index: ./build/gen_make.py
===================================================================
--- ./build/gen_make.py
+++ ./build/gen_make.py Tue Aug 6 17:04:00 2002
@@ -21,8 +21,8 @@
     ('script', 'object'): '',
     }
 
- def __init__(self, fname, oname):
- gen_base.GeneratorBase.__init__(self, fname)
+ def __init__(self, fname, verfname, oname):
+ gen_base.GeneratorBase.__init__(self, fname, verfname)
 
     self.ofile = open(oname, 'w')
     self.ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n')
Index: ./gen-make.py
===================================================================
--- ./gen-make.py
+++ ./gen-make.py Tue Aug 6 17:43:53 2002
@@ -11,10 +11,12 @@
 sys.path.insert(0, 'build')
 import gen_make
 
-def main(fname, oname=None, skip_depends=0):
+def main(fname, verfname=None, oname=None, skip_depends=0):
   if oname is None:
     oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk'
- generator = gen_make.MakefileGenerator(fname, oname)
+ if verfname is None:
+ verfname = os.path.join('subversion', 'include', 'svn_version.h')
+ generator = gen_make.MakefileGenerator(fname, verfname, oname)
   generator.write()
   if not skip_depends:
     generator.write_depends()

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 7 01:26:45 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.