diff options
-rw-r--r-- | desktop/source/deployment/manager/dp_extensionmanager.cxx | 27 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_extensionmanager.hxx | 1 | ||||
-rwxr-xr-x | desktop/source/deployment/manager/dp_manager.cxx | 11 | ||||
-rw-r--r-- | scp2/source/ooo/common_brand.scp | 8 | ||||
-rw-r--r-- | scp2/source/ooo/profileitem_ooo.scp | 17 |
5 files changed, 49 insertions, 15 deletions
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 8939bb97d4e8..9f02fd2ecab4 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -146,20 +146,24 @@ class ExtensionRemoveGuard css::uno::Reference<css::deployment::XPackageManager> m_xPackageManager; public: + ExtensionRemoveGuard(){}; ExtensionRemoveGuard( css::uno::Reference<css::deployment::XPackage> const & extension, css::uno::Reference<css::deployment::XPackageManager> const & xPackageManager): m_extension(extension), m_xPackageManager(xPackageManager) {} ~ExtensionRemoveGuard(); - void reset(css::uno::Reference<css::deployment::XPackage> const & extension) { + void set(css::uno::Reference<css::deployment::XPackage> const & extension, + css::uno::Reference<css::deployment::XPackageManager> const & xPackageManager) { m_extension = extension; + m_xPackageManager = xPackageManager; } }; ExtensionRemoveGuard::~ExtensionRemoveGuard() { try { + OSL_ASSERT(!(m_extension.is() && !m_xPackageManager.is())); if (m_xPackageManager.is() && m_extension.is()) m_xPackageManager->removePackage( dp_misc::getIdentifier(m_extension), ::rtl::OUString(), @@ -213,6 +217,10 @@ Reference<deploy::XPackageManager> ExtensionManager::getTmpRepository() { return m_xPackageManagerFactory->getPackageManager(OUSTR("tmp")); } +Reference<deploy::XPackageManager> ExtensionManager::getBakRepository() +{ + return m_xPackageManagerFactory->getPackageManager(OUSTR("bak")); +} Reference<task::XAbortChannel> ExtensionManager::createAbortChannel() throw (uno::RuntimeException) @@ -678,6 +686,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( //Make sure the extension is removed from the tmp repository in case //of an exception ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository()); + ExtensionRemoveGuard bakExtensionRemoveGuard; const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension); const OUString sFileName = xTmpExtension->getName(); Reference<deploy::XPackage> xOldExtension; @@ -714,22 +723,10 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( xOldExtension->revokePackage( xAbortChannel, Reference<ucb::XCommandEnvironment>()); //save the old user extension in case the user aborts - //store the extension in the tmp repository, this will overwrite - //xTmpPackage (same identifier). Do not let the user abort or - //interact - //importing the old extension in the tmp repository will remove - //the xTmpExtension - //no command environment supplied, only this class shall interact - //with the user! - xExtensionBackup = getTmpRepository()->importExtension( + xExtensionBackup = getBakRepository()->importExtension( xOldExtension, Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>()); - tmpExtensionRemoveGuard.reset(xExtensionBackup); - //xTmpExtension will later be used to check the dependencies - //again. However, only xExtensionBackup will be later removed - //from the tmp repository - xTmpExtension = xExtensionBackup; - OSL_ASSERT(xTmpExtension.is()); + bakExtensionRemoveGuard.set(xExtensionBackup, getBakRepository()); } catch (lang::DisposedException &) { diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index e7a180a05de1..9c0b6f2b2a62 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -249,6 +249,7 @@ private: css::uno::Reference<css::deployment::XPackageManager> getSharedRepository(); css::uno::Reference<css::deployment::XPackageManager> getBundledRepository(); css::uno::Reference<css::deployment::XPackageManager> getTmpRepository(); + css::uno::Reference<css::deployment::XPackageManager> getBakRepository(); bool isUserDisabled(::rtl::OUString const & identifier, ::rtl::OUString const & filename); diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 89ab4d0b7199..9ee8446afd6f 100755 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -399,6 +399,17 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( stampURL = OUSTR( "vnd.sun.star.expand:$TMP_EXTENSIONS/stamp.sys"); } + else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bak") )) { + that->m_activePackages = OUSTR( + "vnd.sun.star.expand:$BAK_EXTENSIONS/extensions"); + that->m_registrationData = OUSTR( + "vnd.sun.star.expand:$BAK_EXTENSIONS"); + that->m_registryCache = OUSTR( + "vnd.sun.star.expand:$BAK_EXTENSIONS/registry"); + stampURL = OUSTR( + "vnd.sun.star.expand:$BAK_EXTENSIONS/stamp.sys"); + } + else if (! context.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") )) { throw lang::IllegalArgumentException( diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 7afdcd81e1ec..88807d27a599 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -1289,6 +1289,14 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Tmp_Extensions Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":TMP_EXTENSIONS}"; End +ProfileItem gid_Brand_Profileitem_Fundamental_Uno_Bak_Extensions + ModuleID = gid_Module_Root_Brand; + ProfileID = gid_Brand_Profile_Fundamental_Ini; + Section = "Bootstrap"; + Key = "BAK_EXTENSIONS"; + Value = "${${OOO_BASE_DIR}/program/" PROFILENAME(fundamentalbasis) ":BAK_EXTENSIONS}"; +End + ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Types ModuleID = gid_Module_Root_Brand; ProfileID = gid_Brand_Profile_Fundamental_Ini; diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp index 3c6dfefc1286..7fea597a3d1c 100644 --- a/scp2/source/ooo/profileitem_ooo.scp +++ b/scp2/source/ooo/profileitem_ooo.scp @@ -246,6 +246,15 @@ ProfileItem gid_Profileitem_Uno_Uno_Bundled_Tmp_Extensions Value = "${$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap) ":UserInstallation}/user/extensions/tmp"; End +ProfileItem gid_Profileitem_Uno_Uno_Bundled_Bak_Extensions + ProfileID = gid_Profile_Uno_Ini; + ModuleID = gid_Module_Root; + Section = "Bootstrap"; + Order = 1; + Key = "BAK_EXTENSIONS"; + Value = "${$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap) ":UserInstallation}/user/extensions/bak"; +End + ProfileItem gid_Profileitem_Uno_Uno_User_Packages_Cache ProfileID = gid_Profile_Uno_Ini; ModuleID = gid_Module_Root; @@ -337,6 +346,14 @@ ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Tmp_Extensions Value = "${$ORIGIN/" PROFILENAME(uno) ":TMP_EXTENSIONS}"; End +ProfileItem gid_Profileitem_Fundamentalbasis_Uno_Bak_Extensions + ModuleID = gid_Module_Root; + ProfileID = gid_Profile_Fundamentalbasis_Ini; + Section = "Bootstrap"; + Key = "BAK_EXTENSIONS"; + Value = "${$ORIGIN/" PROFILENAME(uno) ":BAK_EXTENSIONS}"; +End + ProfileItem gid_Profileitem_Fundamentalbasis_Ure_More_Types ModuleID = gid_Module_Root; ProfileID = gid_Profile_Fundamentalbasis_Ini; |