This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help/version patches

On Mon, Feb 25, 2002 at 10:15:06AM -0800, Joshua Daniel Franklin wrote:
>>Adding version numbers is not a bad idea (although, I can't honestly
>>think of a time when it would have helped to have this information).
>>Adding version numbers in the middle of the program, in the middle of a
>>text string is, IMO, a bad idea.  The version number should be at the
>>top of the program in a
>>const char version[] = "something";
>>and referenced in the version string.
>>As Robert indicated, using the CVS version number is probably the best
>>way to handle this.  setup.exe currently uses the CVS version.  Use
>>that as an example.
>I was trying to avoid doing what setup.exe does.  In the
>there is a grep/sed combo that grabs the version from the Changelog and
>creates a file to include.  This is fine for a lot of files that
>compile into one (setup.exe) but is it really necessary for 13 utils,
>most of which take only one file of code?  What about a sed script that
>takes that CVS/Entries file and creates something like versions.c with:
>const char cygcheck_version[]= "1.23"; const char cygpath_version[]=

Most of the utilities in winsup/utils consist of just one file.  So, there
is no reason to introduce a separate "version" file.  You just use the
cvs version of the file.

For multi-file programs like dumper and cygcheck, it's probably enough
just to use the same technique in the source file which contains main()
and let the person who checks stuff in remember to force a checkin for
the main file.

>which could then be #include'd in each file?  Then at least no one
>would have to edit the version code; it would just make.  (BTW, I used
> as a reference point for the version code; it is currently
>in a hard-coded printf.)

Well, cygpath is wrong.  cygcheck is wrong too, under this scenario, but
not quite as wrong since it at leasts puts the version in its own
string.  I believe, it used to do something similar to cygpath but I
changed it, intending to, someday, make it use cvs versions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]