Hi there,

the attached patches are an attempt to replace the build-id by the
subversion revision; and fix --with-build-version that didn't work.

The svn revision is set in configure (I guess this could have been done
somewhere in the perl installer code).
It supports both subversion and git-svn repositories. In case of plane 
sources without repo, the build-id is set to 0.
(Tested only with git-svn).

With the following configure switches

./configure   \
--with-build-version="$(date +"%Y-%m-%d %H:%M:%S %z (%a, %d %b %Y)")" \
--enable-verbose \
--enable-category-b \
...

the About Dialog looks like:

http://people.apache.org/~arielch/images/AboutDlg.png

You can try with this Win build:

http://people.apache.org/~arielch/packages/OOo-Dev_OOO340m1_Win_x86_install-arc_en-US.zip
On WinXP the BUILD_VER_STRING looks too small, may be the font size
should be increased.

Tests and comments/improvements are welcome :)


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina
From 9b9fd5909d1441c8d4df0f4e7f554d052f22853b Mon Sep 17 00:00:00 2001
From: Ariel Constenla-Haile <[email protected]>
Date: Tue, 20 Dec 2011 16:41:17 -0300
Subject: [PATCH 1/2] Change buildid to svn revision

---
 configure.in        |   44 ++++++++++++++++++++++++++++++++++++++++++++
 set_soenv.in        |    4 ++++
 solenv/inc/minor.mk |    4 ++--
 3 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index b5b55be..2a9bbcc 100644
--- a/configure.in
+++ b/configure.in
@@ -2853,6 +2853,50 @@ if test "$with_alloc" = "internal" -o -z "$with_alloc"; 
then
 fi
 AC_SUBST(ALLOC)
 
+
+dnl ===================================================================
+dnl Build revision
+dnl ===================================================================
+
+AC_MSG_CHECKING([build revision])
+
+BUILD_REVISION=
+_svn_cmd=
+
+if test -d ./.svn; then
+    for prog in "$SUBVERSION" svn; do
+        if test -x $prog; then
+            _svn_cmd=$prog
+            break
+        fi
+    done
+    if test -z _svn_cmd; then
+        AC_MSG_WARN([subversion repository, but subversion program not found. 
Export $$SUBVERSION=path_to_svn])
+    fi
+else
+    for prog in "$GIT" git; do
+        $prog status >/dev/null 2> /dev/null
+        if test $? -eq 0; then
+            _svn_cmd="$prog svn"
+            break
+        fi
+    done
+fi
+
+if test -n "$_svn_cmd"; then
+    BUILD_REVISION=$(echo $($_svn_cmd info) | sed -e 's/^.*Last Changed Rev: 
//g' -e 's/ .*//g')
+    if test -n $BUILD_REVISION; then
+        AC_MSG_RESULT([$BUILD_REVISION])
+    fi
+fi
+
+if test -z $BUILD_REVISION; then
+    BUILD_REVISION="0"
+    AC_MSG_RESULT([No source code repository.])
+fi
+
+AC_SUBST(BUILD_REVISION)
+
 dnl ===================================================================
 dnl Custom build version
 dnl ===================================================================
diff --git a/set_soenv.in b/set_soenv.in
index 2e32307..2692380 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -917,6 +917,9 @@ $USR_OPENWIN          = $USR.$ds."openwin";
 $USR_DT               = $USR.$ds."dt";
 $COMMON_BUILD_TOOLS   = '$SRC_ROOT'.$ds."external".$ds."common";
 
+# allow pro and non-pro
+$outfile = $outfile.$PROEXT;
+
 # Generate alternate output file for sh?
 $outfile_sh = $outfile.".sh";
 
@@ -1643,6 +1646,7 @@ ToFile( "MOZILLA_VERSION",   $MOZILLA_VERSION,   "e" );
 ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" );
 ToFile( "ENABLE_NSS_MODULE",  "@ENABLE_NSS_MODULE@", "e" );
 ToFile( "MOZILLABUILD",  "@MOZILLABUILD@", "e" );
+ToFile( "BUILD_REVISION",  "@BUILD_REVISION@", "e" );
 ToFile( "BUILD_VER_STRING",  "@BUILD_VER_STRING@", "e" );
 if ($platform =~ m/linux/ && $platform =~ m/powerpc/) {
 ToFile( "JITC_PROCESSOR_TYPE","6",                 "e" );
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index d1734c0..1566e38 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
 RSCVERSION=340
-RSCREVISION=340m1(Build:9584)
-BUILD=9584
+RSCREVISION=340m1(Build:$(BUILD_REVISION))
+BUILD=$(BUILD_REVISION)
 LAST_MINOR=m1
 SOURCEVERSION=OOO340
-- 
1.7.7.4

From c0e0ce19300990d5e511553c47b55c4b77cb3d1d Mon Sep 17 00:00:00 2001
From: Ariel Constenla-Haile <[email protected]>
Date: Tue, 20 Dec 2011 16:42:07 -0300
Subject: [PATCH 2/2] Fix some issues with BUILD_VER_STRING on About dialog

---
 cui/source/dialogs/about.cxx   |   16 ++++++++++++----
 cui/source/dialogs/makefile.mk |    4 ++++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index c733fe0..5a66b64 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -231,7 +231,9 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId 
) :
        aBuildData.SetFont( aNewFont );
        aBuildData.SetBackground( aWall );
 #ifdef BUILD_VER_STRING
-       String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) );
+#define _STRINGIFY(x) #x
+#define STRINGIFY(x) _STRINGIFY(x)
+       String aBuildString( DEFINE_CONST_UNICODE( STRINGIFY( BUILD_VER_STRING 
) ) );
 #else
        String aBuildString;
 #endif
@@ -250,10 +252,16 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& 
rId ) :
     long nTextWidth  = aOutSiz.Width() - nDlgMargin;
 
     aCopyrightText.SetText( aCopyrightTextStr );
-       
+
+    // layout fixed text controls
     layoutText( aVersionText, nY, nTextWidth, a6Size );
-       nY += nCtrlMargin;
-    
+    if( aBuildString.Len() > 0 )
+    {
+        nY += ( a6Size.Height() / 2 );
+        layoutText( aBuildData, nY, nTextWidth, a6Size );
+    }
+    nY += nCtrlMargin;
+
        // OK-Button-Position (at the bottom and centered)
        Size aOKSiz = aOKButton.GetSizePixel();
        Point aOKPnt = aOKButton.GetPosPixel();
diff --git a/cui/source/dialogs/makefile.mk b/cui/source/dialogs/makefile.mk
index cd7a989..d5c9124 100644
--- a/cui/source/dialogs/makefile.mk
+++ b/cui/source/dialogs/makefile.mk
@@ -38,6 +38,10 @@ ENABLE_EXCEPTIONS=TRUE
 CFLAGS+= -DENABLE_LAYOUT=1 -I../$(PRJ)/layout/inc 
-I../$(PRJ)/layout/$(INPATH)/inc
 .ENDIF # ENABLE_LAYOUT == TRUE
 
+.IF "$(BUILD_VER_STRING)" != ""
+CFLAGS+= -DBUILD_VER_STRING="$(BUILD_VER_STRING)"
+.ENDIF
+
 # --- Files --------------------------------------------------------
 
 SRS1NAME=dialogs
-- 
1.7.7.4

Attachment: pgpStO3mhv5C0.pgp
Description: PGP signature

Reply via email to