[Libreoffice-commits] .: 2 commits - desktop/inc desktop/source sdext/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Tue Apr 24 11:23:14 PDT 2012


 desktop/inc/app.hxx                                        |    4 
 desktop/source/app/app.cxx                                 |   12 +-
 desktop/source/app/check_ext_deps.cxx                      |   55 +++++--------
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx |    2 
 desktop/source/deployment/inc/dp_misc.h                    |    3 
 desktop/source/deployment/manager/dp_extensionmanager.cxx  |    2 
 desktop/source/deployment/misc/dp_misc.cxx                 |    6 -
 desktop/source/pkgchk/unopkg/unopkg_app.cxx                |    2 
 sdext/source/minimizer/description.xml                     |    2 
 sdext/source/pdfimport/description.xml                     |    2 
 sdext/source/presenter/description.xml                     |    2 
 11 files changed, 45 insertions(+), 47 deletions(-)

New commits:
commit 2d2b19dea1ab401b1b4971ff5b12b87bb11fd666
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 24 19:16:06 2012 +0200

    Force ExtensionManager resync when the implementation changes
    
    ...as checking the lastsynchronized time-stamps can give wrong results if new and old
    impl use same user config and old impl is started once more after new impl is installed,
    in which case per-user data of bundled exts of new impl would not be regenerated,
    leading to inconsistencies.

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index fa4553a..28b2c63 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -130,12 +130,14 @@ class Desktop : public Application
         static sal_Bool         isCrashReporterEnabled();
 
         // first-start (ever) related methods
+        static bool             newInstallation();
+
         static sal_Bool         CheckExtensionDependencies();
 
         static void             DoRestartActionsIfNecessary( sal_Bool bQuickStart );
         static void             SetRestartState();
 
-        void                    SynchronizeExtensionRepositories();
+        void                    SynchronizeExtensionRepositories(bool force);
         void                    SetSplashScreenText( const ::rtl::OUString& rText );
         void                    SetSplashScreenProgress( sal_Int32 );
 
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 6df1561..5d299e1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1608,10 +1608,14 @@ int Desktop::Main()
         // Check if bundled or shared extensions were added /removed
         // and process those extensions (has to be done before checking
         // the extension dependencies!
-        SynchronizeExtensionRepositories();
-        bool bAbort = CheckExtensionDependencies();
-        if ( bAbort )
-            return EXIT_FAILURE;
+        bool newInst = newInstallation();
+        SynchronizeExtensionRepositories(newInst);
+        if ( newInst )
+        {
+            bool bAbort = CheckExtensionDependencies();
+            if ( bAbort )
+                return EXIT_FAILURE;
+        }
 
         {
             ::comphelper::ComponentContext aContext( xSMgr );
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 9a48732..2e0d24a 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -344,33 +344,12 @@ static void impl_setNeedsCompatCheck()
 }
 
 //------------------------------------------------------------------------------
-static bool impl_check()
-{
-    uno::Reference< uno::XComponentContext > xContext = comphelper_getProcessComponentContext();
-
-    bool bDependenciesValid = impl_checkDependencies( xContext );
-
-    short nRet = 0;
-
-    if ( !bDependenciesValid )
-        nRet = impl_showExtensionDialog( xContext );
-
-    if ( nRet == -1 )
-    {
-        impl_setNeedsCompatCheck();
-        return true;
-    }
-    else
-        return false;
-}
-
-//------------------------------------------------------------------------------
 // to check if we need checking the dependencies of the extensions again, we compare
 // the build id of the office with the one of the last check
 //------------------------------------------------------------------------------
-static bool impl_needsCompatCheck()
+bool Desktop::newInstallation()
 {
-    bool bNeedsCheck = false;
+    bool bNewInst = false;
     rtl::OUString aLastCheckBuildID;
     rtl::OUString aCurrentBuildID( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) );
     rtl::Bootstrap::expandMacros( aCurrentBuildID );
@@ -392,18 +371,18 @@ static bool impl_needsCompatCheck()
         result >>= aLastCheckBuildID;
         if ( aLastCheckBuildID != aCurrentBuildID )
         {
-            bNeedsCheck = true;
+            bNewInst = true;
             result <<= aCurrentBuildID;
             pset->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LastCompatibilityCheckID")), result );
             Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
         }
 #ifdef DEBUG
-        bNeedsCheck = true;
+        bNewInst = true;
 #endif
     }
-    catch (const Exception&) {}
+    catch (const com::sun::star::uno::Exception&) {}
 
-    return bNeedsCheck;
+    return bNewInst;
 }
 
 //------------------------------------------------------------------------------
@@ -411,18 +390,28 @@ static bool impl_needsCompatCheck()
 // When there are unresolved issues, we can't continue with startup
 sal_Bool Desktop::CheckExtensionDependencies()
 {
-    sal_Bool bAbort = false;
+    uno::Reference< uno::XComponentContext > xContext = comphelper_getProcessComponentContext();
 
-    if ( impl_needsCompatCheck() )
-        bAbort = impl_check();
+    bool bDependenciesValid = impl_checkDependencies( xContext );
 
-    return bAbort;
+    short nRet = 0;
+
+    if ( !bDependenciesValid )
+        nRet = impl_showExtensionDialog( xContext );
+
+    if ( nRet == -1 )
+    {
+        impl_setNeedsCompatCheck();
+        return true;
+    }
+    else
+        return false;
 }
 
-void Desktop::SynchronizeExtensionRepositories()
+void Desktop::SynchronizeExtensionRepositories(bool force)
 {
     RTL_LOGFILE_CONTEXT(aLog,"desktop (jl) ::Desktop::SynchronizeExtensionRepositories");
-    dp_misc::syncRepositories( new SilentCommandEnv( this ) );
+    dp_misc::syncRepositories( force, new SilentCommandEnv( this ) );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 29ded17..7795e30 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -1124,7 +1124,7 @@ void ExtensionCmdQueue::acceptLicense( const uno::Reference< deployment::XPackag
 
 void ExtensionCmdQueue::syncRepositories( const uno::Reference< uno::XComponentContext > &xContext )
 {
-    dp_misc::syncRepositories( new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) );
+    dp_misc::syncRepositories( false, new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) );
 }
 
 void ExtensionCmdQueue::stop()
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index 29fd140..e9ad4a2 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
@@ -154,7 +154,8 @@ void TRACE(::rtl::OUString const & sText);
     recently added or removed.
 */
 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
-void syncRepositories(::com::sun::star::uno::Reference<
+void syncRepositories(bool force,
+                      ::com::sun::star::uno::Reference<
                       ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv);
 
 }
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index b5822ec..2e22863 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -1223,7 +1223,7 @@ void ExtensionManager::reinstallDeployedExtensions(
         xPackageManager->reinstallDeployedPackages(xAbortChannel, xCmdEnv);
         //We must sync here, otherwise we will get exceptions when extensions
         //are removed.
-        dp_misc::syncRepositories(xCmdEnv);
+        dp_misc::syncRepositories(false, xCmdEnv);
         const uno::Sequence< Reference<deploy::XPackage> > extensions(
             xPackageManager->getDeployedPackages(xAbortChannel, xCmdEnv));
 
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index eb4e6dc..9ed579f 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -590,7 +590,8 @@ void TRACE(::rtl::OString const & sText)
 #endif
 }
 
-void syncRepositories(Reference<ucb::XCommandEnvironment> const & xCmdEnv)
+void syncRepositories(
+    bool force, Reference<ucb::XCommandEnvironment> const & xCmdEnv)
 {
     OUString sDisable;
     ::rtl::Bootstrap::get( OUSTR( "DISABLE_EXTENSION_SYNCHRONIZATION" ), sDisable, OUString() );
@@ -601,7 +602,8 @@ void syncRepositories(Reference<ucb::XCommandEnvironment> const & xCmdEnv)
     //synchronize shared before bundled otherewise there are
     //more revoke and registration calls.
     sal_Bool bModified = false;
-    if (needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("shared")))
+    if (force
+        || needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("shared")))
         || needToSyncRepostitory(OUString(RTL_CONSTASCII_USTRINGPARAM("bundled"))))
     {
         xExtensionManager =
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 2bd4d1b..205e6ef 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -432,7 +432,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
         if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall"))
             && ! subCommand.equals(OUSTR("sync"))
             && ! dp_misc::office_is_running())
-            dp_misc::syncRepositories(xCmdEnv);
+            dp_misc::syncRepositories(false, xCmdEnv);
 
         if ( subcmd_add || subCommand == "remove" )
         {
commit de562138eabd3ee3ecab28e5d1348a3fee7301e0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 24 19:03:13 2012 +0200

    Bump extension versions after changing to passive registration
    
    ...otherwise, if they are bundled, their per-user data is not regenerated, leading
    to inconsitencies.

diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml
index b204312..f071a06 100644
--- a/sdext/source/minimizer/description.xml
+++ b/sdext/source/minimizer/description.xml
@@ -11,7 +11,7 @@
         <OpenOffice.org-minimal-version value="2.3" dep:name="OpenOffice.org 2.3"/>
     </dependencies>
 
-    <version value="1.0.3"/>
+    <version value="1.0.4"/>
 
     <platform value="@PLATFORM@"/>
 
diff --git a/sdext/source/pdfimport/description.xml b/sdext/source/pdfimport/description.xml
index b75aeb8..0816004 100644
--- a/sdext/source/pdfimport/description.xml
+++ b/sdext/source/pdfimport/description.xml
@@ -10,7 +10,7 @@
         <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
     </dependencies>
 
-    <version value="1.0.5" />
+    <version value="1.0.6" />
 
     <platform value="@PLATFORM@" />
 
diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml
index 8c647d6..be71e44 100644
--- a/sdext/source/presenter/description.xml
+++ b/sdext/source/presenter/description.xml
@@ -11,7 +11,7 @@
     <OpenOffice.org-minimal-version value="3.3" dep:name="OpenOffice.org 3.3"/>
   </dependencies>
 
-  <version value="1.1.0" />
+  <version value="1.1.1" />
 
   <platform value="@PLATFORM@" />
 


More information about the Libreoffice-commits mailing list