]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make patchlevel.h be the master version file
authorTom Yu <tlyu@mit.edu>
Sat, 25 Sep 2004 01:00:55 +0000 (01:00 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 25 Sep 2004 01:00:55 +0000 (01:00 +0000)
ticket: 1345
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16790 dc483132-0cff-0310-8789-dd5450dbe970

14 files changed:
src/ChangeLog
src/configure.in
src/lib/ChangeLog
src/lib/Makefile.in
src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/Makefile.in
src/lib/krb5/krb/brand.c
src/patchlevel.h
src/util/ChangeLog
src/util/mkrel
src/util/send-pr/ChangeLog
src/util/send-pr/Makefile.in
src/windows/ChangeLog
src/windows/version.rc

index 6555d2dcb4e9844f8c0550b6f2b8d6152ffdb609..d333e864bc6557a725084f3c4386a1ea92e3bbd6 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * aclocal.m4 (AC_KRB5_TCL_FIND_CONFIG): If the config info set by
index 4a5ad0c9b1ce209dfb269481f6a687a89fdc2d73..fc567f2980c46e2b019c7c2563a11cf08e64f3db 100644 (file)
@@ -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
index 1528b30b4ff15f786b562ee9dac9be9b13e3c19b..d8ddd197066f8f2ce43efee0270c40351e3ecce6 100644 (file)
@@ -1,3 +1,7 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (RCFLAGS): Add -I$(SRCTOP) to get patchlevel.h.
+
 2004-06-18  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (SLIBS, SDEF, S_GLUE, COMERR_GLUE, PROF_GLUE,
index c52ddb925e4d2270873c90f3abf7b8b75f79e5dd..909fadcb6030f8588350afc10115109e78b81b24 100644 (file)
@@ -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)
index c16ad787a059b2b9b3d72acb65cd920c8300be0a..46e3f5c0e59d850cbc91f6a87ba6645d551b782a 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (LOCALINCLUDES): Include SRCTOP to get patchlevel.h.
+
+       * brand.c: Use patchlevel.h as master version stamp file.
+
 2004-09-21  Tom Yu  <tlyu@mit.edu>
 
        * rd_cred.c (decrypt_credencdata): Clear and free ppart to avoid
index 9c37865bf82fa724073c3fe2b7dde4cbb3577889..3430d6da7859133a652e1ecdd38abc20f3a3445d 100644 (file)
@@ -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 = ..\..\..
index de48d5880bc16b8d8979909fcb4ff5d37ffede42..7e4e0dbd00415222a0cbb60b7175513cfc294851 100644 (file)
@@ -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: <cvs tag> <date>" */
+/* Format: "KRB5_BRAND: <cvs_tag> <release_name> <date>" */
+
+#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;
index 807b86f5bb45d913c16a19c9f04bcec43bdbc351..a5206281a6d4b0c9414373105f93f6faf0dc7442 100644 (file)
@@ -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 */
index e15aeb039c0fbae9b9e43f7ba086b84501c7c9f5..990ca78cf1067de1a91b258b0e08835dd72b0e21 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * mkrel: Rework somewhat to handle patchlevel.h being the new
+       master version stamp file.
+
 2004-09-14  Ken Raeburn  <raeburn@mit.edu>
 
        * reconf: Export ACLOCAL=true to environment.
index a576fbd228cdc5f617ecc640a1efbd65fd7f7b45..97a08d1260fb9f8fa2ba7c472a48ae07a7f57c8c 100644 (file)
@@ -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 <<EOF
+       (cd $reldir/src && \
+               cat > patchlevel.h <<EOF
 #define KRB5_MAJOR_RELEASE $relmajor
 #define KRB5_MINOR_RELEASE $relminor
 #define KRB5_PATCHLEVEL    $relpatch
 EOF
-)
+       )
+fi
 
 echo "Nuking unneeded files..."
 find $reldir \( -name TODO -o -name todo -o -name .cvsignore \
        -o -name BADSYMS -o -name .Sanitize -o -name .rconf \) -print \
-       | xargs rm -f
-find $reldir -type d -name autom4te.cache -exec rm -rf {} \;
+       | xargs rm -f || true
+find $reldir -type d -name autom4te.cache -exec rm -rf {} \; || true
 
 if test $dodoc = t; then
        echo "Building doc..."
index 4ae543edfe4e70631c4a825d260b17228ef3db0c..d443d91726fed040eea97c76b0a98c7d21798144 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (RELEASE): Set from KRB5_VERSION, which comes from
+       patchlevel.h.
+
 2004-03-08  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (MY_SUBDIRS): Deleted.
index 5a27fcbf0b630298a651008b1c4133c1f7c1349c..6d586c69e555ef4f73208db69d0206d9023a4cd5 100644 (file)
@@ -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
index d09feec5a3870d24795d15cb51604c46242c8cf6..5dcadcfd5a697e39b20fca5038fe000ca2968811 100644 (file)
@@ -1,3 +1,7 @@
+2004-09-24  Tom Yu  <tlyu@mit.edu>
+
+       * version.rc: Use patchlevel.h to generate version stamp info.
+
 2004-06-18  Ken Raeburn  <raeburn@mit.edu>
 
        * version.rc: Add info for support library.
index 3951dbdeead73fc8bc38614662b188b6fd829d71..58da7b0b7b3ba78d29904b871f7c6aba319bfd7d 100644 (file)
@@ -1,17 +1,31 @@
 #include <windows.h>
 #include <winver.h>
+#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
 
 
 /* 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"
 
 /*