From: Tom Yu Date: Sat, 25 Sep 2004 01:00:55 +0000 (+0000) Subject: Make patchlevel.h be the master version file X-Git-Tag: krb5-1.4-beta1~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a63d79f93e746f611f37a7e3c9c1c13aaa7c6db3;p=thirdparty%2Fkrb5.git Make patchlevel.h be the master version file ticket: 1345 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16790 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index 6555d2dcb4..d333e864bc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-09-24 Tom Yu + + * configure.in: Update to get RELTAIL from patchlevel.h as well. + + * patchlevel.h: Update to make this the master version stamp file. + 2004-09-22 Ken Raeburn * aclocal.m4 (AC_KRB5_TCL_FIND_CONFIG): If the config info set by diff --git a/src/configure.in b/src/configure.in index 4a5ad0c9b1..fc567f2980 100644 --- a/src/configure.in +++ b/src/configure.in @@ -11,8 +11,14 @@ dnl CONFIG_RULES dnl dnl Determine version from patchlevel.h -eval `sed 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/' < $srcdir/patchlevel.h` -KRB5_VERSION="$KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE.$KRB5_PATCHLEVEL" +eval `sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < $srcdir/patchlevel.h` +KRB5_VERSION="$KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE" +if test "$KRB5_PATCHLEVEL" = 0; then :; else + KRB5_VERSION="$KRB5_VERSION.$KRB5_PATCHLEVEL" +fi +if test -n "$KRB5_RELTAIL"; then + KRB5_VERSION="$KRB5_VERSION-$KRB5_RELTAIL" +fi AC_SUBST(KRB5_VERSION) dnl AC_REQUIRE_CPP diff --git a/src/lib/ChangeLog b/src/lib/ChangeLog index 1528b30b4f..d8ddd19706 100644 --- a/src/lib/ChangeLog +++ b/src/lib/ChangeLog @@ -1,3 +1,7 @@ +2004-09-24 Tom Yu + + * Makefile.in (RCFLAGS): Add -I$(SRCTOP) to get patchlevel.h. + 2004-06-18 Ken Raeburn * Makefile.in (SLIBS, SDEF, S_GLUE, COMERR_GLUE, PROF_GLUE, diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index c52ddb925e..909fadcb60 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -66,7 +66,7 @@ KGLUE=$(K5_GLUE) GGLUE=$(GSS_GLUE) K4GLUE=$(K4_GLUE) -RCFLAGS=$(CPPFLAGS) -D_WIN32 -DRES_ONLY +RCFLAGS=$(CPPFLAGS) -I$(SRCTOP) -D_WIN32 -DRES_ONLY ##WIN32##SRES=$(SLIB:.lib=.res) ##WIN32##CRES=$(CLIB:.lib=.res) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index c16ad787a0..46e3f5c0e5 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2004-09-24 Tom Yu + + * Makefile.in (LOCALINCLUDES): Include SRCTOP to get patchlevel.h. + + * brand.c: Use patchlevel.h as master version stamp file. + 2004-09-21 Tom Yu * rd_cred.c (decrypt_credencdata): Clear and free ppart to avoid diff --git a/src/lib/krb5/krb/Makefile.in b/src/lib/krb5/krb/Makefile.in index 9c37865bf8..3430d6da78 100644 --- a/src/lib/krb5/krb/Makefile.in +++ b/src/lib/krb5/krb/Makefile.in @@ -5,7 +5,7 @@ BUILDTOP=$(REL)..$(S)..$(S).. RUN_SETUP = @KRB5_RUN_ENV@ PROG_LIBPATH=-L$(TOPLIBD) PROG_RPATH=$(KRB5_LIBDIR) -LOCALINCLUDES = -I$(srcdir)/../os +LOCALINCLUDES = -I$(srcdir)/../os -I$(SRCTOP) ##DOS##BUILDTOP = ..\..\.. diff --git a/src/lib/krb5/krb/brand.c b/src/lib/krb5/krb/brand.c index de48d5880b..7e4e0dbd00 100644 --- a/src/lib/krb5/krb/brand.c +++ b/src/lib/krb5/krb/brand.c @@ -1,15 +1,72 @@ +/* + * lib/krb5/krb/brand.c + * + * Copyright (C) 2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + /* * This file is used to put a "release brand" on a Krb5 library before * it is released via some release engineering process. This gives us * an easy way to tell where a binary came from. * - * It currently is manually maintained, because there's no good way to - * automatically have CVS do the right thing. We could put RCS tags - * in every single file, but that (a) takes up lots of space, since we - * have lots of files in the Kerberos library, and (b) it makes CVS - * merges a real pain. + * It depends on patchlevel.h for the master version stamp info. */ -/* Format: "KRB5_BRAND: " */ +/* Format: "KRB5_BRAND: " */ + +#include "patchlevel.h" + +#define XSTR(x) #x +#define STR(x) XSTR(x) + +#ifdef KRB5_RELTAG +#define RELTAG KRB5_RELTAG +#else +#define RELTAG "[untagged]" +#endif + +#define MAJOR_MINOR STR(KRB5_MAJOR_RELEASE) "." STR(KRB5_MINOR_RELEASE) + +#if KRB5_PATCHLEVEL != 0 +#define MAYBE_PATCH "." STR(KRB5_PATCHLEVEL) +#else +#define MAYBE_PATCH "" +#endif + +#ifdef KRB5_RELTAIL +#define RELTAIL "-" KRB5_RELTAIL +#else +#define RELTAIL "" +#endif + +#define RELNAME MAJOR_MINOR MAYBE_PATCH RELTAIL + +#ifdef KRB5_RELDATE +#define RELDATE KRB5_RELDATE +#else +#define RELDATE "[date unknown]" +#endif + +#define BRANDSTR RELTAG " " RELNAME " " RELDATE -static char krb5_brand[] = "KRB5_BRAND: Unbranded release"; +static char krb5_brand[] = "KRB5_BRAND: " BRANDSTR; diff --git a/src/patchlevel.h b/src/patchlevel.h index 807b86f5bb..a5206281a6 100644 --- a/src/patchlevel.h +++ b/src/patchlevel.h @@ -1,3 +1,58 @@ +/* + * patchlevel.h + * + * Copyright (C) 2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +/* + * This is the master file for version stamping purposes. The + * checked-in version will contain the correct version information at + * all times. Prior to an official release x.y.z, + * KRB5_MAJOR_RELEASE=x, KRB5_MINOR_RELEASE=y, and KRB5_PATCHLEVEL=z. + * KRB5_RELTAIL will reflect the release state. It will be + * "prerelease" for unreleased code either on the trunk or on a + * release branch. It will be undefined for a final release. + * + * Immediately following a final release, the release version numbers + * will be incremented, and KRB5_RELTAIL will revert to "prerelease". + * + * KRB5_RELTAG contains the CVS tag name corresponding to the release. + * KRB5_RELDATE identifies the date of the release. They should + * normally be undefined for checked-in code. + */ + +/* + * ========== + * IMPORTANT: + * ========== + * + * If you are a vendor supplying modified code derived from MIT + * Kerberos, you SHOULD update KRB5_RELTAIL to identify your + * organization. + */ #define KRB5_MAJOR_RELEASE 1 -#define KRB5_MINOR_RELEASE 2 -#define KRB5_PATCHLEVEL 2 +#define KRB5_MINOR_RELEASE 4 +#define KRB5_PATCHLEVEL 0 +#define KRB5_RELTAIL "prerelease" +/* #undef KRB5_RELDATE */ +/* #undef KRB5_RELTAG */ diff --git a/src/util/ChangeLog b/src/util/ChangeLog index e15aeb039c..990ca78cf1 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,8 @@ +2004-09-24 Tom Yu + + * mkrel: Rework somewhat to handle patchlevel.h being the new + master version stamp file. + 2004-09-14 Ken Raeburn * reconf: Export ACLOCAL=true to environment. diff --git a/src/util/mkrel b/src/util/mkrel index a576fbd228..97a08d1260 100644 --- a/src/util/mkrel +++ b/src/util/mkrel @@ -1,6 +1,6 @@ #!/bin/sh set -e -repository=:kserver:cvs.mit.edu:/cvs/krbdev +repository=:gserver:cvs.mit.edu:/cvs/krbdev dodoc=t dosrc=t checkout=t @@ -32,7 +32,7 @@ relmajor=0 relminor=0 relpatch=0 relhead= -reltail= +# reltail= reldate=`date +%Y%m%d` case "$reldir" in @@ -92,6 +92,45 @@ echo "major=$relmajor minor=$relminor patch=$relpatch" # $reltag, $release, $reldate are used for brand.c currently # $relmajor, $relminor, $relpatch are used for patchlevel.h currently +# +# $newstyle = t if patchlevel.h is the master version stamp file. If +# so, we don't edit it here. +# +if test $checkout = t; then + if cvs -q -d $repository checkout -p -r$reltag krb5/src/patchlevel.h | grep KRB5_RELDATE > /dev/null 2>&1; then + newstyle=t + else + newstyle=nil; + fi +else + if grep KRB5_RELDATE $reldir/src/patchlevel.h > /dev/null 2>&1; then + newstyle=t; + else + newstyle=nil; + fi +fi + +if test $newstyle = t; then + echo "parsing new style patchlevel.h..." + if test $checkout = t; then + eval `cvs -q -d $repository checkout -p -r$reltag krb5/src/patchlevel.h | sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p'` + else + eval `sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < $reldir/src/patchlevel.h` + fi + if test "$KRB5_RELTAG" != $reltag; then + echo "WARNING: patchlevel.h '$KRB5_RELTAG' != $reltag" + fi + if test "$KRB5_MAJOR_RELEASE" != $relmajor || \ + test "$KRB5_MINOR_RELEASE" != $relminor || \ + test "$KRB5_PATCHLEVEL" != $relpatch || \ + test "$KRB5_RELTAIL" != $reltail; then + + echo "WARNING: patchlevel.h $KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE.$KRB5_PATCHLEVEL${KRB5_RELTAIL+-$KRB5_RELTAIL} != $relmajor.$relminor.$relpatch${reltail+-$reltail}" + fi +else + echo "old style patchlevel.h" +fi + if test $checkout = t; then echo "Checking out krb5 with tag $reltag into directory $reldir..." cvs -q -d $repository export -r$reltag -d $reldir krb5 @@ -115,28 +154,36 @@ fi echo "Editing release-specific files..." -(cd $reldir/src/lib/krb5/krb && \ - sed -e '/static/s%KRB5_BRAND:[^"]*"%'"KRB5_BRAND: $reltag $release $reldate"'"%' \ - brand.c > brand.c.new && mv brand.c.new brand.c; \ - rm -f brand.c.new) +if test $newstyle = t; then + (cd $reldir/src && \ + sed -e '/RELDATE/c\ +#define KRB5_RELDATE "'"$reldate"'"' patchlevel.h > patchlevel.h.new && \ + mv patchlevel.h.new patchlevel.h) +else + + (cd $reldir/src/lib/krb5/krb && \ + sed -e '/static/s%KRB5_BRAND:[^"]*"%'"KRB5_BRAND: $reltag $release $reldate"'"%' \ + brand.c > brand.c.new && mv brand.c.new brand.c; \ + rm -f brand.c.new) -(cd $reldir/src/util/send-pr && \ - sed -e 's%RELEASE=.*%RELEASE='"krb5-$release"'%' Makefile.in \ - > Makefile.in.new && mv Makefile.in.new Makefile.in) + (cd $reldir/src/util/send-pr && \ + sed -e 's%RELEASE=.*%RELEASE='"krb5-$release"'%' Makefile.in \ + > Makefile.in.new && mv Makefile.in.new Makefile.in) -(cd $reldir/src && \ - cat > patchlevel.h < patchlevel.h < + + * Makefile.in (RELEASE): Set from KRB5_VERSION, which comes from + patchlevel.h. + 2004-03-08 Ken Raeburn * Makefile.in (MY_SUBDIRS): Deleted. diff --git a/src/util/send-pr/Makefile.in b/src/util/send-pr/Makefile.in index 5a27fcbf0b..6d586c69e5 100644 --- a/src/util/send-pr/Makefile.in +++ b/src/util/send-pr/Makefile.in @@ -5,7 +5,7 @@ BUILDTOP=$(REL)..$(S).. # # Makefile for building a standalone send-pr. # -RELEASE=1.0 +RELEASE=@KRB5_VERSION@ SUBMITTER=net sendprname = krb5-send-pr EMACS=emacs diff --git a/src/windows/ChangeLog b/src/windows/ChangeLog index d09feec5a3..5dcadcfd5a 100644 --- a/src/windows/ChangeLog +++ b/src/windows/ChangeLog @@ -1,3 +1,7 @@ +2004-09-24 Tom Yu + + * version.rc: Use patchlevel.h to generate version stamp info. + 2004-06-18 Ken Raeburn * version.rc: Add info for support library. diff --git a/src/windows/version.rc b/src/windows/version.rc index 3951dbdeea..58da7b0b7b 100644 --- a/src/windows/version.rc +++ b/src/windows/version.rc @@ -1,17 +1,31 @@ #include #include +#include "patchlevel.h" /* * BEGIN COMMON VERSION INFO for GSS and Kerberos version resources */ -#define PRE_RELEASE +#define XSTR(x) #x +#define STR(x) XSTR(x) -#ifdef PRE_RELEASE -#define BETA_STR " beta" +#define MAJOR_MINOR STR(KRB5_MAJOR_RELEASE) "." STR(KRB5_MINOR_RELEASE) + +#if KRB5_PATCH_LEVEL != 0 +#define MAYBE_PATCH "." STR(KRB5_PATCHLEVEL) +#else +#define MAYBE_PATCH "" +#endif + +#ifdef KRB5_RELTAIL +#define RELTAIL "-" KRB5_RELTAIL +#else +#define RELTAIL "" +#endif + +#ifdef BETA #define BETA_FLAG VS_FF_PRERELEASE #else -#define BETA_STR "" #define BETA_FLAG 0 #endif @@ -23,10 +37,10 @@ /* we're going to stamp all the DLLs with the same version number */ -#define K5_PRODUCT_VERSION_STRING "1.3 (TEST)" BETA_STR "\0" -#define K5_PRODUCT_VERSION 1, 3, 0, 0 +#define K5_PRODUCT_VERSION_STRING MAJOR_MINOR MAYBE_PATCH RELTAIL "\0" +#define K5_PRODUCT_VERSION KRB5_MAJOR_RELEASE, KRB5_MINOR_RELEASE, KRB5_PATCHLEVEL, 0 -#define K5_COPYRIGHT "Copyright (C) 1997-2000 by the Massachusetts Institute of Technology\0" +#define K5_COPYRIGHT "Copyright (C) 1997-2004 by the Massachusetts Institute of Technology\0" #define K5_COMPANY_NAME "Massachusetts Institute of Technology.\0" /*