[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - extensions/source setup_native/prj setup_native/source setup_native/tests

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Oct 27 18:28:47 PDT 2009


 extensions/source/logging/filehandler.cxx                                    |   11 -
 extensions/source/logging/logger.cxx                                         |    2 
 setup_native/prj/d.lst                                                       |    5 
 setup_native/source/opensolaris/bundledextensions/README                     |   80 +++++++
 setup_native/source/opensolaris/bundledextensions/installed                  |    1 
 setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml |   60 +++++
 setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions |  108 ++++++++++
 setup_native/tests/opensolaris/bundledextensions/send_ooo                    |   32 ++
 8 files changed, 298 insertions(+), 1 deletion(-)

New commits:
commit f37dbda31edc561c6902f63d307c41f3626114f1
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Tue Oct 27 17:23:06 2009 +0000

    CWS-TOOLING: integrate CWS jl133
    2009-10-20 11:47:23 +0200 jl  r277045 : CWS-TOOLING: rebase CWS jl133 to branches/OOO320 at 276942 (milestone: OOO320:m2)
    2009-09-30 12:23:43 +0200 jl  r276551 : #i103747# added dependency to local filesystem service
    2009-09-14 14:12:18 +0200 jl  r276113 : #i103747#
    2009-09-14 14:09:41 +0200 jl  r276112 : #i103747#
    2009-09-14 13:24:20 +0200 jl  r276108 : #i103747#
    2009-09-11 08:27:43 +0200 jl  r276049 : #i103747# changes for opensolaris bundled extensions
    2009-09-11 08:21:36 +0200 jl  r276048 : #i103747# changes for opensolaris bundled extensions

diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst
index a573b94..9d42945 100644
--- a/setup_native/prj/d.lst
+++ b/setup_native/prj/d.lst
@@ -8,6 +8,7 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
 ..\%__SRC%\bin\uninstall %_DEST%\bin%_EXT%\userscripts\uninstall
 ..\%__SRC%\bin\noarch\fake-db-1.0-0.noarch.rpm %_DEST%\bin%_EXT%\openoffice.org-userland-1.0-0.noarch.rpm
 
+mkdir: %_DEST%\bin%_EXT%\osolsmf
 ..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv
 ..\%__SRC%\bin\langpackscript.sh %_DEST%\bin%_EXT%\langpackscript.sh
 ..\%__SRC%\bin\linuxpatchscript.sh %_DEST%\bin%_EXT%\linuxpatchscript.sh
@@ -33,6 +34,10 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
 ..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif
 ..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat
 ..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat
+..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed
+..\source\opensolaris\bundledextensions\README %_DEST%\bin%_EXT%\osolsmf\README
+..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml
+..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions
 ..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile
 ..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt
 ..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp
diff --git a/setup_native/source/opensolaris/bundledextensions/README b/setup_native/source/opensolaris/bundledextensions/README
new file mode 100644
index 0000000..f64c225
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/README
@@ -0,0 +1,80 @@
+================================================================================
+Installation information
+================================================================================
+
+In order to properly install the bundled extensions, such as dictionaries, it is
+necessary that the files 
+
+installed
+ooo_bundled_extensions.xml
+svc-ooo_bundled_extensions
+
+are part of the OpenOffice.org IPS package. They must be added to the package
+after all other files have been added. Those other files are the SVR4 packages
+of OOo which can be imported by pkg (pkg import).
+The files have to be uploaded this way:
+
+pkgsend -s url_to_pkg_server add file installed   mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s url_to_pkg_server add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s url_to_pkg_server add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+ 
+---
+
+${EXTENSIONPATH} must be replaced by the path to the folder containing the
+bundled extensions. This path changes with every major release of OOo because of
+the version number which is part of a folder name. The
+current value is:
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+The service was tested with OpenSolaris release 2009.6 and may not work with a
+previous release. 
+
+
+================================================================================
+What do these files do
+================================================================================
+
+The three files constitute a SMF service. When this service is started, then it
+installes the bundled extensions which are contained in
+/opt/openoffice.org3/share/extension/install. To install them, the service calls
+"unopkg add --shared ..." with the appropriate arguments.
+
+The service is started initially after the installation of
+ooo_bundled_extensions.xml. At this time, all files of OOo, including the
+extensions, have been copied to their destination. The service calls unopkg on
+behalf of every extension and adds the path to that extension to the file
+'installed'. The file 'installed' is used to remember what extensions have
+already been installed with unopkg. This will prevent to reinstall those
+extensions whenever the service is restarted.
+
+When a new version of OOo becomes available, then the respective OOo package
+containes a new version of 'installed'. That is, it contains a version string,
+such as 3.2.0. The sole reason for that string is, to change the content of this
+file in every release. Otherwise IPS would not replace the installed version of
+'installed' with the one contained in the package. 
+
+The update procedure of OOo will replace 'installed'. 'installed' is associated
+with a restart_fmri of the service ooo_bundled_extensions. That is after
+copying 'installed' the service will be restarted. It then installes all
+extensions contained in /opt/openoffice.org3/share/extension/install, because
+the newly installed 'installed' file does not contain any entries yet, except
+for the version string.
+
+
+================================================================================
+Known issues
+================================================================================
+
+If OOo, which contains this service, is uninstalled and later it is installed
+again, then the bundled extensions are not installed. That is, unopkg is not
+called to install them with OOo's Extensions Manager. The reasons is a bug in
+OpenSolaris:  
+
+http://defect.opensolaris.org/bz/show_bug.cgi?id=5742
+
+To work around this, one can call after uninstalling OOo
+
+svccfg delete -f ooo_bundled_extensions
+svccfg delete smf/manifest
diff --git a/setup_native/source/opensolaris/bundledextensions/installed b/setup_native/source/opensolaris/bundledextensions/installed
new file mode 100644
index 0000000..0c8d8df
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/installed
@@ -0,0 +1 @@
+${OOOPACKAGEVERSION}
diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
new file mode 100644
index 0000000..3dc4a11
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<service_bundle type="manifest" name="ooo_bundled_extensions">
+
+<service
+   name="application/ooo_bundled_extensions"
+   type="service"
+   version="1">
+
+  <create_default_instance enabled="true" />
+  <single_instance/>
+
+  <dependency name="service_available"
+          grouping="require_all"
+          restart_on="none"
+          type="service">
+    <service_fmri value="svc:/system/filesystem/local:default" />
+  </dependency>
+
+  <exec_method
+     type="method" name="start"
+     exec="/lib/svc/method/svc-ooo_bundled_extensions start"
+     timeout_seconds="160">
+    <method_context>
+      <method_credential user="root" group="root" />
+    </method_context>
+  </exec_method>
+  
+  
+  <exec_method
+     type="method" name="stop"
+     exec="/lib/svc/method/svc-ooo_bundled_extensions stop"
+     timeout_seconds="160" >
+    <method_context>
+      <method_credential user="root" group="root" />
+    </method_context>
+  </exec_method>
+  
+  <property_group name="startd" type="framework">
+    <propval name="duration" type="astring"
+         value="transient" /> 
+    <propval name="ignore_error"
+         type="astring" value="core,signal" />
+    
+  </property_group>  
+
+  <stability value="Unstable" />
+  
+  <template>
+    <common_name>
+      <loctext xml:lang="C">
+    Installation of OpenOffice.org's bundled extensions.
+      </loctext>
+    </common_name>
+  </template>
+</service>
+
+</service_bundle>
diff --git a/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
new file mode 100644
index 0000000..6962770
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
@@ -0,0 +1,108 @@
+#!/sbin/sh
+
+. /lib/svc/share/smf_include.sh
+
+#The start method is used for installing and updating the
+#extensions. The service keeps a list
+#(share/extensions/install/installed) of the extensions which were
+#already installed. During installation, the bundled extensions are
+#copied to the install folder (share/extensions/install). Finally this
+#service, which is part of the office installation package, will be
+#started and the start "method" of this script is called. Then all
+#extensions in the "install" folder are checked if they are already
+#installed by reading the list "installed". Because the list is empty
+#at this time, all the extensions will be installed.
+#
+#If this service is restarted then the script checks if there is an
+#extensions which is not yet installed, that is there is no entry for
+#it in the 'installed' file. Only if this is the case then that
+#extensions will be installed and its path is added to 'installed'.
+#
+#In case of an update, new versions of existing extensions and
+#completely new extensions may be copied to the 'install' folder. Also
+#a new 'installed' file will be copied which replaces the existing
+#file. The new 'installed' file does not contain any entries of
+#installed extensions. Therefore the next time when the start method is
+#run all extensions contained in share/extensions/install will be
+#installed.
+
+#Create the folder which contains the temporary user installation
+INSTDIR=`/usr/bin/mktemp -d "/tmp/userinstall.XXXXXX"`
+
+OOO_BASE_DIR="/opt/openoffice.org/basis${OOOBASEVERSION}"
+
+case "$1" in
+'start')
+    EXTENSIONDIR=/opt/openoffice.org${OOOBRANDPACKAGEVERSION}/share/extension/install
+    for FILE in $EXTENSIONDIR/*.oxt
+    do
+	#We check if the file exist, because if there is no extension
+	#then $FILE will contain "<..>/*.oxt"
+	if [ -f "$FILE" ]; then
+            #Determine if this extension is already installed. We do
+	    #that by checking the file "installed" which contains a
+	    #list of all installed extensions including the full path
+	    EXTENSIONFILE=`basename $FILE`
+	    INSTALLED=`sed -n "/$EXTENSIONFILE/p" $EXTENSIONDIR/installed`
+	    
+	    if [ -z "$INSTALLED" ]; then
+	        #We have not found the name of the extension in the
+		#list. That is, it has not been installed (with unopkg) yet.
+		#Therefore we do it now.
+		echo installing $FILE
+		/opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg add --shared --bundled "$FILE" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+		#Let us remember that this extensions has been installed
+		#by adding the path name of the extension to the file 
+		#installed
+		echo $FILE >> $EXTENSIONDIR/installed
+	    fi
+	fi
+    done
+    
+    #Now check for extensions which need to be uninstalled
+    #(unopkg). This is the case if the list of extensions in the file
+    #installed contains the name of an extension which does not exist
+    #in the the folder <..>/share/extension/install.
+#     LINE=""
+#     NEWCONTENT=""
+#     REMOVED=""
+#     LIST=`cat $EXTENSIONDIR/installed`
+#     #remove blank lines
+#     LIST=`echo "$LIST" | sed '/^[:blank:]*$/d'`
+ 
+#     echo "$LIST" |  while [ 1 ]
+#     do
+# 	read LINE || break
+# 	if [ ! -f "$LINE" ]; then
+# 	    #The extension file has been removed from
+# 	    #share/extension/install. Now we remove the installed
+# 	    #extension
+# 	    echo removing `basename $LINE`
+# 	    /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg remove --shared --bundled "`basename $LINE`" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+# 	    REMOVED=1
+# 	else
+# 	    NEWCONTENT+=$LINE 
+# 	    NEWCONTENT+="\n"	    
+# 	fi
+#     done 
+
+#     #Write the new list to the file "installed". It now has all names
+#     #remove which refered to previously removed extensions (removed
+#     #from .../share/extension/install)
+#     if  [ "$REMOVED" ]; then
+# 	#remove the last empty line
+# 	NEWCONTENT=`echo "$NEWCONTENT" | sed '/^[:space:]*$/d'`
+# 	echo "$NEWCONTENT" > $EXTENSIONDIR/installed
+#     fi
+    
+    ;;
+    'stop')
+	echo "#### stop ####"
+	;;
+    *)
+	echo "Usage: $0 { start | stop }"
+	exit 1
+	;;
+esac
+
+exit $SMF_EXIT_OK
diff --git a/setup_native/tests/opensolaris/bundledextensions/send_ooo b/setup_native/tests/opensolaris/bundledextensions/send_ooo
new file mode 100644
index 0000000..669e63c
--- /dev/null
+++ b/setup_native/tests/opensolaris/bundledextensions/send_ooo
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+
+if  [ $# = 0 ]
+then
+echo "usage: send_ooo path_to_pkg_folder
+
+The files 
+installed, 
+ooo_bundled_extension.xml,
+svc-ooo_bundled_extension
+must be in the current directory. The pkg.depotd or the service
+application/pkg/server must listen to port 80"
+
+exit
+fi
+
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+eval `pkgsend -s http://localhost:80 open ooo_test at 3.2-1`
+pkgsend -s http://localhost:80 import $1/openofficeorg-ure
+pkgsend -s http://localhost:80 import $1/ooobasis*
+pkgsend -s http://localhost:80 import $1/openofficeorg3*
+
+pkgsend -s http://localhost:80 add file installed   mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s http://localhost:80 add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s http://localhost:80 add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+pkgsend -s http://localhost:80 add set name=description value="OOo 3.2 with dictionaries:  en fr es da de"
+pkgsend -s http://localhost:80 close
+
commit 0b397f800ec8312c857a7ef4de12772e727eb2c7
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Tue Oct 27 12:27:51 2009 +0000

    CWS-TOOLING: integrate CWS oooimprovement5
    2009-10-14 15:43:16 +0200 b_michaelsen  r276902 : #i105835# removing explict flushes in comphelper as logging::Logger handles flushing
    2009-10-14 15:40:00 +0200 b_michaelsen  r276901 : #i105835# logging::Filehandler::flush flushes, logging::Logger::publish flushes all handlers
    2009-10-14 14:56:03 +0200 b_michaelsen  r276900 : #i105835# flushing filehandler in uieventslogger after each logged record because of buffered i/o
    2009-10-14 14:52:32 +0200 b_michaelsen  r276899 : #i105835# loading the user feedback log readonly with the csv-filter (no need for an import dialog)
    2009-10-14 14:40:46 +0200 od  r276898 : #i105571# method <SwFntObj::GetCrsrOfst(..)>
              - skip character cells also for CJK

diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx
index 00d9bd5..c7f628e 100644
--- a/extensions/source/logging/filehandler.cxx
+++ b/extensions/source/logging/filehandler.cxx
@@ -328,7 +328,16 @@ namespace logging
     void SAL_CALL FileHandler::flush(  ) throw (RuntimeException)
     {
         MethodGuard aGuard( *this );
-        // nothing to do, our ::osl::File implementation is not buffered
+        if(!m_pFile.get())
+        {
+            OSL_PRECOND(false, "FileHandler::flush: no file!");
+            return;
+        }
+        #if OSL_DEBUG_LEVEL > 0
+            ::osl::FileBase::RC res =
+        #endif
+                m_pFile->sync();
+        OSL_ENSURE(res == ::osl::FileBase::E_None, "FileHandler::flush: Could not sync logfile to filesystem.");
     }
     
     //--------------------------------------------------------------------
diff --git a/extensions/source/logging/logger.cxx b/extensions/source/logging/logger.cxx
index 599f481..041f89b 100644
--- a/extensions/source/logging/logger.cxx
+++ b/extensions/source/logging/logger.cxx
@@ -230,6 +230,8 @@ namespace logging
 
         m_aHandlers.forEach< XLogHandler >(
             ::boost::bind( &XLogHandler::publish, _1, ::boost::cref( _rRecord ) ) );
+        m_aHandlers.forEach< XLogHandler >(
+            ::boost::bind( &XLogHandler::flush, _1 ) );
     }
 
     //--------------------------------------------------------------------


More information about the ooo-build-commit mailing list