diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-08-10 15:52:22 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-08-13 18:05:02 +0200 |
commit | de63d48f9b8be0f5099f054e0978f3e0d3750864 (patch) | |
tree | ccfc60445291e0d2a12295047cbce74e1bc5e089 /desktop | |
parent | cbb047527d856258b7b925dc37f56f0e9b0b3e90 (diff) |
Related fdo#51252: No more prereg, no more unopkg sync
Now that 5c47e5f63a79a9e72ec4a100786b1bbf65137ed4 "fdo#51252 Disable copying
share/prereg/bundled to avoid startup crashes" removed the use of share/prereg,
there is no longer need to generate it in the first place (by calling "unopkg
sync" at build or installation time), and so no need for the "unopkg sync" sub-
command, either. This also allows to simplify some of the jvmfwk code that was
only there so that "unopkg sync" (which can require a JVM) can work in "hostile"
environments (during build and installation).
Conflicts:
setup_native/prj/d.lst
Change-Id: I52657384f4561bf27948ba4f0f88f4498e90987f
Signed-off-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'desktop')
-rwxr-xr-x | desktop/scripts/unopkg.sh | 13 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 264 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_extensionmanager.cxx | 75 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_extensionmanager.hxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 21 | ||||
-rw-r--r-- | desktop/source/deployment/registry/configuration/dp_configuration.cxx | 1 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_backend.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/registry/executable/dp_executable.cxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/registry/inc/dp_backend.h | 2 | ||||
-rw-r--r-- | desktop/source/deployment/registry/sfwk/dp_sfwk.cxx | 5 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_app.cxx | 52 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 106 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_shared.h | 4 |
13 files changed, 15 insertions, 542 deletions
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh index 9856d191b68f..4bb36bbfd887 100755 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh @@ -64,27 +64,18 @@ esac #collect all bootstrap variables specified on the command line #so that they can be passed as arguments to javaldx later on -#Recognize the "sync" option. sync must be applied without any other -#options except bootstrap variables or the verbose option for arg in $@ do case "$arg" in -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";; - sync) OPTSYNC=true;; -v) VERBOSE=true;; --verbose) VERBOSE=true;; - *) OPTOTHER=$arg;; esac done -if [ "$OPTSYNC" = "true" ] && [ -z "$OPTOTHER" ] -then - JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$BRAND_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' -fi - # extend the ld_library_path for java: javaldx checks the sofficerc for us if [ -x "$sd_prog/../ure-link/bin/javaldx" ] ; then - my_path=`"$sd_prog/../ure-link/bin/javaldx" $BOOTSTRAPVARS $JVMFWKPARAMS \ + my_path=`"$sd_prog/../ure-link/bin/javaldx" $BOOTSTRAPVARS \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` if [ -n "$my_path" ] ; then sd_platform=`uname -s` @@ -110,6 +101,6 @@ unset XENVIRONMENT # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS # execute binary -exec "$sd_prog/unopkg.bin" "$@" $JVMFWKPARAMS \ +exec "$sd_prog/unopkg.bin" "$@" \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc" diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index eff4d04f7f9a..cb9d3c370b74 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -143,10 +143,6 @@ namespace desktop static oslSignalHandler pSignalHandler = 0; static sal_Bool _bCrashReporterEnabled = sal_True; -#ifndef ANDROID -static ::rtl::OUString getBrandSharePreregBundledPathURL(); -#endif - namespace { void removeTree(OUString const & url) { @@ -513,246 +509,6 @@ rtl::OUString ReplaceStringHookProc( const rtl::OUString& rStr ) return sRet; } -static const char pLastSyncFileName[] = "lastsynchronized"; -static const sal_Int32 nStrLenLastSync = 16; - -#ifndef ANDROID - -static bool needsSynchronization( - ::rtl::OUString const & baseSynchronizedURL, ::rtl::OUString const & userSynchronizedURL ) -{ - bool bNeedsSync( false ); - - ::osl::DirectoryItem itemUserFile; - ::osl::File::RC err1 = - ::osl::DirectoryItem::get(userSynchronizedURL, itemUserFile); - - //If it does not exist, then there is nothing to be done - if (err1 == ::osl::File::E_NOENT) - { - return true; - } - else if (err1 != ::osl::File::E_None) - { - OSL_FAIL("Cannot access lastsynchronized in user layer"); - return true; //sync just in case - } - - //If last synchronized does not exist in base layer, then do nothing - ::osl::DirectoryItem itemBaseFile; - ::osl::File::RC err2 = ::osl::DirectoryItem::get(baseSynchronizedURL, itemBaseFile); - if (err2 == ::osl::File::E_NOENT) - { - return true; - - } - else if (err2 != ::osl::File::E_None) - { - OSL_FAIL("Cannot access file lastsynchronized in base layer"); - return true; //sync just in case - } - - //compare the modification time of the extension folder and the last - //modified file - ::osl::FileStatus statUser(osl_FileStatus_Mask_ModifyTime); - ::osl::FileStatus statBase(osl_FileStatus_Mask_ModifyTime); - if (itemUserFile.getFileStatus(statUser) == ::osl::File::E_None) - { - if (itemBaseFile.getFileStatus(statBase) == ::osl::File::E_None) - { - TimeValue timeUser = statUser.getModifyTime(); - TimeValue timeBase = statBase.getModifyTime(); - - if (timeUser.Seconds < timeBase.Seconds) - bNeedsSync = true; - } - else - { - OSL_ASSERT(0); - bNeedsSync = true; - } - } - else - { - OSL_ASSERT(0); - bNeedsSync = true; - } - - return bNeedsSync; -} - -static ::rtl::OUString getBrandSharePreregBundledPathURL() -{ - ::rtl::OUString url( - "$BRAND_BASE_DIR/share/prereg/bundled"); - - ::rtl::Bootstrap::expandMacros(url); - return url; -} - -static ::rtl::OUString getUserBundledExtPathURL() -{ - ::rtl::OUString folder( "$BUNDLED_EXTENSIONS_USER" ); - ::rtl::Bootstrap::expandMacros(folder); - - return folder; -} - -static ::rtl::OUString getLastSyncFileURLFromBrandInstallation() -{ - ::rtl::OUString aURL = getBrandSharePreregBundledPathURL(); - ::sal_Int32 nLastIndex = aURL.lastIndexOf('/'); - - ::rtl::OUStringBuffer aTmp( aURL ); - - if ( nLastIndex != aURL.getLength()-1 ) - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pLastSyncFileName ); - - return aTmp.makeStringAndClear(); -} - -static ::rtl::OUString getLastSyncFileURLFromUserInstallation() -{ - ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL(); - ::sal_Int32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); - - ::rtl::OUStringBuffer aTmp( aUserBundledPathURL ); - - if ( nLastIndex != aUserBundledPathURL.getLength()-1 ) - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pLastSyncFileName ); - - return aTmp.makeStringAndClear(); -} - -#endif - -//Checks if the argument src is the folder of the help or configuration -//backend in the prereg folder -static bool excludeTmpFilesAndFolders(const rtl::OUString & src) -{ - const char helpBackend[] = "com.sun.star.comp.deployment.help.PackageRegistryBackend"; - const char configBackend[] = "com.sun.star.comp.deployment.configuration.PackageRegistryBackend"; - if (src.endsWithAsciiL(helpBackend, sizeof(helpBackend) - 1 ) - || src.endsWithAsciiL(configBackend, sizeof(configBackend) - 1)) - { - return true; - } - return false; -} - -//If we are about to copy the contents of some special folder as determined -//by excludeTmpFilesAndFolders, then we omit those files or folders with a name -//derived from temporary folders. -static bool isExcludedFileOrFolder( const rtl::OUString & name) -{ - char const * allowed[] = { - "backenddb.xml", - "configmgr.ini", - "registered_packages.db" - }; - - const unsigned int size = sizeof(allowed) / sizeof (char const *); - bool bExclude = true; - for (unsigned int i= 0; i < size; i ++) - { - ::rtl::OUString allowedName = ::rtl::OUString::createFromAscii(allowed[i]); - if (allowedName.equals(name)) - { - bExclude = false; - break; - } - } - return bExclude; -} - -static osl::FileBase::RC copy_bundled_recursive( - const rtl::OUString& srcUnqPath, - const rtl::OUString& dstUnqPath, - sal_Int32 TypeToCopy ) -throw() -{ - osl::FileBase::RC err = osl::FileBase::E_None; - - if( TypeToCopy == -1 ) // Document - { - err = osl::File::copy( srcUnqPath,dstUnqPath ); - } - else if( TypeToCopy == +1 ) // Folder - { - err = osl::Directory::create( dstUnqPath ); - osl::FileBase::RC next = err; - if( err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST ) - { - err = osl::FileBase::E_None; - - osl::Directory aDir( srcUnqPath ); - bool bExcludeFiles = excludeTmpFilesAndFolders(srcUnqPath); - if (aDir.open() == osl::FileBase::E_None) - { - sal_Int32 n_Mask = osl_FileStatus_Mask_FileURL | - osl_FileStatus_Mask_FileName | - osl_FileStatus_Mask_Type; - - osl::DirectoryItem aDirItem; - while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None ) - { - sal_Bool IsDoc = false; - sal_Bool bFilter = false; - osl::FileStatus aFileStatus( n_Mask ); - aDirItem.getFileStatus( aFileStatus ); - if( aFileStatus.isValid( osl_FileStatus_Mask_Type ) ) - IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular; - - // Getting the information for the next recursive copy - sal_Int32 newTypeToCopy = IsDoc ? -1 : +1; - - rtl::OUString newSrcUnqPath; - if( aFileStatus.isValid( osl_FileStatus_Mask_FileURL ) ) - newSrcUnqPath = aFileStatus.getFileURL(); - - rtl::OUString newDstUnqPath = dstUnqPath; - rtl::OUString tit; - if( aFileStatus.isValid( osl_FileStatus_Mask_FileName ) ) - { - ::rtl::OUString aFileName = aFileStatus.getFileName(); - tit = rtl::Uri::encode( aFileName, - rtl_UriCharClassPchar, - rtl_UriEncodeIgnoreEscapes, - RTL_TEXTENCODING_UTF8 ); - - // Special treatment for "lastsychronized" file. Must not be - // copied from the bundled folder! - //Also do not copy *.tmp files and *.tmp_ folders. This affects the files/folders - //from the help and configuration backend - if ( IsDoc && (aFileName.equalsAscii( pLastSyncFileName ) - || (bExcludeFiles && isExcludedFileOrFolder(aFileName)))) - bFilter = true; - else if (!IsDoc && bExcludeFiles && isExcludedFileOrFolder(aFileName)) - bFilter = true; - } - - if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 ) - newDstUnqPath += rtl::OUString("/"); - - newDstUnqPath += tit; - - if (( newSrcUnqPath != dstUnqPath ) && !bFilter ) - err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy ); - } - - if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT ) - err = next; - - aDir.close(); - } - } - } - - return err; -} - Desktop::Desktop() : m_bServicesRegistered( false ) , m_aBootstrapError( BE_OK ) @@ -771,26 +527,6 @@ void Desktop::Init() refreshBundledExtensionsDir(); - // Check for lastsynchronized file for bundled extensions in the user directory - // and test if synchronzation is necessary! -#ifndef ANDROID - { - ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation(); - ::rtl::OUString aPreregSyncFilePathURL = getLastSyncFileURLFromBrandInstallation(); - - if ( needsSynchronization( aPreregSyncFilePathURL, aUserLastSyncFilePathURL )) - { - rtl::OUString aUserPath = getUserBundledExtPathURL(); - rtl::OUString aPreregBundledPath = getBrandSharePreregBundledPathURL(); - - // copy bundled folder to the user directory - osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); - (void) rc; - if (false) copy_bundled_recursive( aPreregBundledPath, aUserPath, +1 ); - } - } -#endif - // We need to have service factory before going further, but see fdo#37195. // Doing this will mmap common.rdb, making it not overwritable on windows, // so this can't happen before the synchronization above. Lets rework this diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index f2a6fce0a0ff..68403f1af6cb 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1258,64 +1258,6 @@ void ExtensionManager::reinstallDeployedExtensions( } } -/** Works on the bundled repository. That is using the variables - BUNDLED_EXTENSIONS and BUNDLED_EXTENSIONS_USER. - */ -void ExtensionManager::synchronizeBundledPrereg( - Reference<task::XAbortChannel> const & xAbortChannel, - Reference<ucb::XCommandEnvironment> const & xCmdEnv ) - throw (deploy::DeploymentException, - uno::RuntimeException) -{ - try - { - String sSynchronizingBundled(StrSyncRepository::get()); - sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUSTR("bundled")); - dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled); - - Reference<deploy::XPackageManagerFactory> xPackageManagerFactory( - deploy::thePackageManagerFactory::get(m_xContext)); - - Reference<deploy::XPackageManager> xMgr = - xPackageManagerFactory->getPackageManager(OUSTR("bundled_prereg")); - xMgr->synchronize(xAbortChannel, xCmdEnv); - progressBundled.update(OUSTR("\n\n")); - - uno::Sequence<Reference<deploy::XPackage> > extensions = xMgr->getDeployedPackages( - xAbortChannel, xCmdEnv); - try - { - for (sal_Int32 i = 0; i < extensions.getLength(); i++) - { - extensions[i]->registerPackage(true, xAbortChannel, xCmdEnv); - } - } - catch (...) - { - OSL_ASSERT(0); - } - OUString lastSyncBundled(RTL_CONSTASCII_USTRINGPARAM( - "$BUNDLED_EXTENSIONS_PREREG/lastsynchronized")); - writeLastModified(lastSyncBundled, xCmdEnv); - - } catch ( const deploy::DeploymentException& ) { - throw; - } catch ( const ucb::CommandFailedException & ) { - throw; - } catch ( const ucb::CommandAbortedException & ) { - throw; - } catch (const lang::IllegalArgumentException &) { - throw; - } catch (const uno::RuntimeException &) { - throw; - } catch (...) { - uno::Any exc = ::cppu::getCaughtException(); - throw deploy::DeploymentException( - OUSTR("Extension Manager: exception in synchronize"), - static_cast<OWeakObject*>(this), exc); - } -} - sal_Bool ExtensionManager::synchronize( Reference<task::XAbortChannel> const & xAbortChannel, Reference<ucb::XCommandEnvironment> const & xCmdEnv ) @@ -1342,14 +1284,15 @@ sal_Bool ExtensionManager::synchronize( bModified |= getBundledRepository()->synchronize(xAbortChannel, xCmdEnv); progressBundled.update(OUSTR("\n\n")); - //Always determine the active extension. This is necessary for the - //first-start optimization. The setup creates the registration data for the - //bundled extensions (brand_layer/share/prereg/bundled), which is copied to the user - //installation (user_installation/extension/bundled) when a user starts OOo - //for the first time after running setup. All bundled extensions are registered - //at that moment. However, extensions with the same identifier can be in the - //shared or user repository, in which case the respective bundled extensions must - //be revoked. + //Always determine the active extension. + //TODO: Is this still necessary? (It used to be necessary for the + // first-start optimization: The setup created the registration data + // for the bundled extensions (share/prereg/bundled) which was copied to + // the user installation when a user started OOo for the first time + // after running setup. All bundled extensions were registered at that + // moment. However, extensions with the same identifier could be in the + // shared or user repository, in which case the respective bundled + // extensions had to be revoked.) try { const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > > diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index f1a99dbcef4c..22e2d41c20b9 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -201,12 +201,6 @@ public: css::lang::IllegalArgumentException, css::uno::RuntimeException); - virtual void SAL_CALL synchronizeBundledPrereg( - css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel, - css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv ) - throw (css::deployment::DeploymentException, - css::uno::RuntimeException); - virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL getExtensionsWithUnacceptedLicenses( ::rtl::OUString const & repository, diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index cda94fb2e6d5..8a08320cd6ea 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -391,24 +391,6 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( //No stamp file. We assume that bundled is always readonly. It must not be //modified from ExtensionManager but only by the installer } - else if ( context == "bundled_prereg" ) { - //This is a bundled repository but the registration data - //is in the brand layer: share/prereg - //It is special because the registration data are copied at the first startup - //into the user installation. The processed help and xcu files are not - //copied. Instead the backenddb.xml for the help backend references the help - //by using $BUNDLED_EXTENSION_PREREG instead $BUNDLED_EXTENSIONS_USER. The - //configmgr.ini also used $BUNDLED_EXTENSIONS_PREREG to refer to the xcu file - //which contain the replacement for %origin%. - that->m_activePackages = OUSTR( - "vnd.sun.star.expand:$BUNDLED_EXTENSIONS"); - that->m_registrationData = OUSTR( - "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG"); - that->m_registryCache = OUSTR( - "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/registry"); - logFile = OUSTR( - "vnd.sun.star.expand:$BUNDLED_EXTENSIONS_PREREG/log.txt"); - } else if ( context == "tmp" ) { that->m_activePackages = OUSTR( "vnd.sun.star.expand:$TMP_EXTENSIONS/extensions"); @@ -989,8 +971,7 @@ OUString PackageManagerImpl::getDeployPath( ActivePackages::Data const & data ) //The bundled extensions are not contained in an additional folder //with a unique name. data.temporaryName contains already the //UTF8 encoded folder name. See PackageManagerImpl::synchronize - if (!m_context.equals(OUSTR("bundled")) - && !m_context.equals(OUSTR("bundled_prereg"))) + if (!m_context.equals(OUSTR("bundled"))) { buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_/") ); buf.append( ::rtl::Uri::encode( data.fileName, rtl_UriCharClassPchar, diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index d28e3e9c62b2..b0fb42597a43 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -735,7 +735,6 @@ void BackendImpl::PackageImpl::processPackage_( //No need for live-deployment for bundled extension, because OOo //restarts after installation if (that->m_eContext != CONTEXT_BUNDLED - && that->m_eContext != CONTEXT_BUNDLED_PREREG && !startup) { if (m_isSchema) diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 16bc5d1445ff..e6e7640273b1 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -102,8 +102,6 @@ PackageRegistryBackend::PackageRegistryBackend( m_eContext = CONTEXT_BUNDLED; else if ( m_context == "tmp" ) m_eContext = CONTEXT_TMP; - else if ( m_context == "bundled_prereg" ) - m_eContext = CONTEXT_BUNDLED_PREREG; else if (m_context.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") )) m_eContext = CONTEXT_DOCUMENT; diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index a64193293011..17c056d6443b 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -256,8 +256,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( else if (getMyBackend()->m_context.equals(OUSTR("shared"))) attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe | osl_File_Attribute_OthExe); - else if (!getMyBackend()->m_context.equals(OUSTR("bundled")) - && !getMyBackend()->m_context.equals(OUSTR("bundled_prereg"))) + else if (!getMyBackend()->m_context.equals(OUSTR("bundled"))) //Bundled extension are required to be in the properly //installed. That is an executable must have the right flags OSL_ASSERT(0); @@ -286,8 +285,7 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE")); else if (getMyBackend()->m_context.equals(OUSTR("shared"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE")); - else if (getMyBackend()->m_context.equals(OUSTR("bundled")) - || getMyBackend()->m_context.equals(OUSTR("bundled_prereg"))) + else if (getMyBackend()->m_context.equals(OUSTR("bundled"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS")); else OSL_ASSERT(0); diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index 9fb0595270b3..919b559c9719 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -300,7 +300,7 @@ protected: // currently only for library containers: enum { CONTEXT_UNKNOWN, - CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, CONTEXT_BUNDLED_PREREG, + CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, CONTEXT_DOCUMENT } m_eContext; bool m_readOnly; diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index a7f5cdfa0f28..5741ccc2bea2 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -310,11 +310,6 @@ void BackendImpl::PackageImpl:: initPackageHandler() { aContext <<= OUSTR("bundled"); } - else if ( that->m_eContext == CONTEXT_BUNDLED_PREREG ) - { - aContext <<= OUSTR("bundled_prereg"); - } - else { OSL_ASSERT( 0 ); diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 2bd4d1b99214..43faed54656a 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -374,45 +374,6 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() if (e != osl_File_E_None && e != osl_File_E_NOENT) throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0); } - else if (subCommand.equals(OUSTR("sync"))) - { - //sync is private!!!! Only to be called from setup!!! - //The UserInstallation is diverted to the prereg folder. But only - //the lock file is written! This requires that - //-env:UNO_JAVA_JFW_INSTALL_DATA is passed to javaldx and unopkg otherwise the - //javasettings file is written to the prereg folder. - // - //For performance reasons unopkg sync is called during the setup and - //creates the registration data for the repository of the bundled - //extensions. It is then copied to the user installation during - //startup of OOo (userdata/extensions/bundled). The registration - //data is in the brand installation and must be removed when - //uninstalling OOo. We do this here, before UNO is - //bootstrapped. Otherwies files could be locked by this process. - - //If there is no folder left in - //$BRAND_BASE_DIR/share/extensions - //then we can delete the registration data at - //$BUNDLED_EXTENSIONS_USER - if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) - { - removeFolder(OUSTR("$BUNDLED_EXTENSIONS_PREREG")); - //return otherwise we create the registration data again - return 0; - } - //redirect the UserInstallation, so we do not create a - //user installation for the admin and we also do not need - //to call unopkg with -env:UserInstallation - ::rtl::Bootstrap::set(OUSTR("UserInstallation"), - OUSTR("$BUNDLED_EXTENSIONS_PREREG/..")); - //Setting UNO_JAVA_JFW_INSTALL_DATA causes the javasettings to be written - //in the office installation. We do not want to create the user data folder - //for the admin. The value must also be set in the unopkg script (Linux, etc.) - //when calling javaldx - ::rtl::Bootstrap::set(OUSTR("UNO_JAVA_JFW_INSTALL_DATA"), - OUSTR("$BRAND_BASE_DIR/share/config/javasettingsunopkginstall.xml")); - - } xComponentContext = getUNO( disposeGuard, option_verbose, option_shared, subcmd_gui, @@ -430,7 +391,6 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() //prevent the deletion of the registry data folder //synching is done in XExtensionManager.reinstall if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall")) - && ! subCommand.equals(OUSTR("sync")) && ! dp_misc::office_is_running()) dp_misc::syncRepositories(xCmdEnv); @@ -621,18 +581,6 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() xDialog->startExecuteModal(xListener); dialogEnded.wait(); } - else if ( subCommand == "sync" ) - { - if (! dp_misc::office_is_running()) - { - xExtensionManager->synchronizeBundledPrereg( - Reference<task::XAbortChannel>(), xCmdEnv); - } - else - { - dp_misc::writeConsoleError(OUSTR("\nError: office is running")); - } - } else { dp_misc::writeConsoleError( diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index c7b5e67aa155..52b4ab884a1b 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -524,112 +524,6 @@ Reference<XComponentContext> getUNO( return xComponentContext; } -//Determines if a folder does not contains a folder. -//Return false may also mean that the status could not be determined -//because some error occurred. -bool hasNoFolder(OUString const & folderUrl) -{ - bool ret = false; - OUString url = folderUrl; - ::rtl::Bootstrap::expandMacros(url); - ::osl::Directory dir(url); - osl::File::RC rc = dir.open(); - if (rc == osl::File::E_None) - { - bool bFolderExist = false; - osl::DirectoryItem i; - osl::File::RC rcNext = osl::File::E_None; - while ( (rcNext = dir.getNextItem(i)) == osl::File::E_None) - { - osl::FileStatus stat(osl_FileStatus_Mask_Type); - if (i.getFileStatus(stat) == osl::File::E_None) - { - if (stat.getFileType() == osl::FileStatus::Directory) - { - bFolderExist = true; - break; - } - } - else - { - dp_misc::writeConsole( - OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); - break; - } - i = osl::DirectoryItem(); - } - - if (rcNext == osl::File::E_NOENT || - rcNext == osl::File::E_None) - { - if (!bFolderExist) - ret = true; - } - else - { - dp_misc::writeConsole( - OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); - } - - dir.close(); - } - else - { - dp_misc::writeConsole( - OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); - } - return ret; -} - -void removeFolder(OUString const & folderUrl) -{ - OUString url = folderUrl; - ::rtl::Bootstrap::expandMacros(url); - ::osl::Directory dir(url); - ::osl::File::RC rc = dir.open(); - if (rc == osl::File::E_None) - { - ::osl::DirectoryItem i; - ::osl::File::RC rcNext = ::osl::File::E_None; - while ( (rcNext = dir.getNextItem(i)) == ::osl::File::E_None) - { - ::osl::FileStatus stat(osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileURL); - if (i.getFileStatus(stat) == ::osl::File::E_None) - { - ::osl::FileStatus::Type t = stat.getFileType(); - if (t == ::osl::FileStatus::Directory) - { - //remove folder - removeFolder(stat.getFileURL()); - } - else if (t == ::osl::FileStatus::Regular) - { - //remove file - ::osl::File::remove(stat.getFileURL()); - } - else - { - OSL_ASSERT(0); - } - } - else - { - dp_misc::writeConsole( - OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); - break; - } - i = ::osl::DirectoryItem(); - } - dir.close(); - ::osl::Directory::remove(url); - } - else if (rc != osl::File::E_NOENT) - { - dp_misc::writeConsole( - OUSTR("unopkg: Error while removing ") + url + OUSTR("\n")); - } -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index c8de646b12ce..400e2835199e 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -173,10 +173,6 @@ css::uno::Reference<css::uno::XComponentContext> getUNO( DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui, css::uno::Reference<css::uno::XComponentContext> & out_LocalComponentContext); -bool hasNoFolder(::rtl::OUString const & folderUrl); - -void removeFolder(::rtl::OUString const & folderUrl); - } |