Re: check_version

2005-07-18 Thread Simon Josefsson
ight bug too, hence patch below. Thanks. 2005-07-18 Simon Josefsson <[EMAIL PROTECTED]> * check-version.c (check_version): Accept identical versions too. --- check-version.c 16 Jul 2005 21:29:45 +0200 1.2 +++ check-version.c 18 Jul 2005 15:50:25 +0200 @@ -40,7 +

Re: check_version

2005-07-18 Thread Bruno Haible
Simon Josefsson wrote: > having a AC_DEFINE seem somewhat hackish. No, why is this odd? Here's what I use in gettext to avoid collisions of the "lock in libintl" with "lock outside libintl". dnl Rename some macros and functions used for locking. AH_BOTTOM([ #define glthread_lock_init libi

Re: check_version

2005-07-16 Thread Simon Josefsson
texi 16 Jul 2005 19:40:57 - @@ -295,7 +295,7 @@ fail. @node Library version handling @section Library version handling -The module ``check_version'' can be useful when your gnulib +The module @samp{check-version} can be useful when your gnulib application is a system library.

Re: check_version

2005-07-14 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: >> The gnulib module could set >> something like that up, to avoid manual config.h additions. > > The name of the xxx_check_version function is something that each package > will want to define explicitly. I don't think deducing its name through a > rule is

Re: check_version

2005-07-14 Thread Bruno Haible
Simon Josefsson wrote: > > #define stringprep_check_version check_version > > instead of a function that calls check_version. > > I assume you meant: > > #define check_version stringprep_check_version Yes, it's backwards. (I was thinking about changing check_vers

Re: check_version

2005-07-14 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> +const char * >> +check_version (const char *req_version) >> +{ >> + if (!req_version || strverscmp (req_version, VERSION) < 0) >> +return VERSION; >> + >> + return NUL

Re: [bug-gnulib] Re: check_version

2005-07-11 Thread Bruno Haible
Simon Josefsson wrote: > +const char * > +check_version (const char *req_version) > +{ > + if (!req_version || strverscmp (req_version, VERSION) < 0) > +return VERSION; > + > + return NULL; > +} > ... > You will typically wrap the call to the > `check_ver

Re: check_version

2005-06-28 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: > >>+ if (!req_version || strverscmp (req_version, VERSION) < 0) >>+return VERSION; >> >> > > Why did you choose to call the version string "VERSION" rather than > using the "PACKAGE_VERSION" string automatically defined by AC

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >No particular reason. VERSION is defined automatically by AC_INIT >too, is it not? Is there a difference between PACKAGE_VERSION and >VERSION? I'd be happy to change, it doesn't matter for me. > > The CVS config.h is only showing `PACKAGE_VERSION'. Regards, Derek

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >Ok, unless someone suggests otherwise, I'll change it to >PACKAGE_VERSION later tonight. Perhaps it is Automake that define >VERSION. > > The CVS project uses Automake 1.9.5 and Autoconf 2.59 and VERSION does not get defined. We might not be using a macro that defines

Re: check_version

2005-06-28 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: > >>No particular reason. VERSION is defined automatically by AC_INIT >>too, is it not? Is there a difference between PACKAGE_VERSION and >>VERSION? I'd be happy to change, it doesn't matter for me. >> >> > > The CVS config.h is

Re: check_version

2005-06-28 Thread Derek Price
Simon Josefsson wrote: >+ if (!req_version || strverscmp (req_version, VERSION) < 0) >+return VERSION; > > Why did you choose to call the version string "VERSION" rather than using the "PACKAGE_VERSION" string automatically defined by AC_INIT? Regards, Derek __

Re: check_version

2005-06-28 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> Ah, right. I accidentally installed the m4 file. Ok to install the >> rest too? > > Sure. It looks fine to me. Done. ___ bug-gnulib mailing list bug-gnulib@gnu

Re: check_version

2005-06-28 Thread Simon Josefsson
die ("version mismatch\n"); >>> >>> Even if strverscmp itself can't be used directly, it seems to me that >>> its use would greatly simplify this package, and avoid the >>> integer-overflow glitches Jim mentioned. >> >> Good idea!

Re: check_version

2005-06-28 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > Ah, right. I accidentally installed the m4 file. Ok to install the > rest too? Sure. It looks fine to me. Thanks. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-g

Re: check_version

2005-06-28 Thread Jim Meyering
sed directly, it seems to me that >> its use would greatly simplify this package, and avoid the >> integer-overflow glitches Jim mentioned. > > Good idea! How about this? > > 2005-06-25 Simon Josefsson <[EMAIL PROTECTED]> > > * modules/check_version: New f

Re: check_version

2005-06-27 Thread Simon Josefsson
w it can be useful. I added the following to the manual. Please install improvements as appropriate... Should something like this go into the source code too? I think it is slightly noisy. 1.6 Library version handling The module "check_version" can be useful whe

Re: check_version

2005-06-27 Thread Simon Josefsson
teger-overflow glitches Jim mentioned. Good idea! How about this? 2005-06-25 Simon Josefsson <[EMAIL PROTECTED]> * modules/check_version: New file. 2005-06-25 Simon Josefsson <[EMAIL PROTECTED]> * check_version.h, check_version.c: New file. Index: lib/check_vers

Re: check_version

2005-06-26 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: >/* Check version of libgcrypt. */ >if (!gcry_check_version (GCRYPT_VERSION)) > die ("version mismatch\n"); Can't you use strverscmp for this? E.g.: if (strverscmp (GCRYPT_VERSION, VERSION) < 0) die ("version mismatc

Re: check_version

2005-06-25 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > Not sure I follow the higher-level language part... Perhaps I should > explain more what I use this for. > > I use it in my libraries, which are all written in C. The source code Thanks for explaining. That's what I suspected. What do you think about

Re: check_version

2005-06-25 Thread Simon Josefsson
Jim Meyering <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> wrote: >> I'm using this module in all of my GNU packages. One complication >> might be that it depends on VERSION being defined. Feedback >> appreciated. > > Looks useful, but sounds like a job better implemented > i

Re: check_version

2005-06-25 Thread Jim Meyering
Simon Josefsson <[EMAIL PROTECTED]> wrote: > I'm using this module in all of my GNU packages. One complication > might be that it depends on VERSION being defined. Feedback > appreciated. Looks useful, but sounds like a job better implemented in a higher level language. But maybe you have const

Re: check_version

2005-06-25 Thread Simon Josefsson
Simon Josefsson <[EMAIL PROTECTED]> writes: > Index: lib/check_version.c Just realized: it should #include check_version.h. Other than that, I have now built and tested the module in one project. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://

check_version

2005-06-25 Thread Simon Josefsson
I'm using this module in all of my GNU packages. One complication might be that it depends on VERSION being defined. Feedback appreciated. 2005-06-25 Simon Josefsson <[EMAIL PROTECTED]> * modules/check_version: New file. 2005-06-25 Simon Josefsson <[E