jl154 #i113463# processPackage_ in dp_configuration.cxx threw an IOException when revoking xcs files

This commit is contained in:
Joachim Lingner
2010-07-28 12:19:34 +02:00
parent 25291f60b2
commit ac751d3424

View File

@@ -359,10 +359,6 @@ void BackendImpl::configmgrini_verify_init(
do { do {
OUString token( line.getToken( 0, ' ', index ).trim() ); OUString token( line.getToken( 0, ' ', index ).trim() );
if (token.getLength() > 0) { if (token.getLength() > 0) {
// cleanup, check if existing:
if (create_ucb_content(
0, expandUnoRcTerm(token), xCmdEnv,
false /* no throw */ )) {
//The file may not exist anymore if a shared or bundled //The file may not exist anymore if a shared or bundled
//extension was removed, but it can still be in the configmgrini. //extension was removed, but it can still be in the configmgrini.
//After running XExtensionManager::synchronize, the configmgrini is //After running XExtensionManager::synchronize, the configmgrini is
@@ -370,7 +366,6 @@ void BackendImpl::configmgrini_verify_init(
m_xcs_files.push_back( token ); m_xcs_files.push_back( token );
} }
} }
}
while (index >= 0); while (index >= 0);
} }
if (readLine( &line, OUSTR("DATA="), ucb_content, if (readLine( &line, OUSTR("DATA="), ucb_content,
@@ -378,32 +373,16 @@ void BackendImpl::configmgrini_verify_init(
sal_Int32 index = sizeof ("DATA=") - 1; sal_Int32 index = sizeof ("DATA=") - 1;
do { do {
OUString token( line.getToken( 0, ' ', index ).trim() ); OUString token( line.getToken( 0, ' ', index ).trim() );
if (token.getLength() > 0) { if (token.getLength() > 0)
{
if (token[ 0 ] == '?') if (token[ 0 ] == '?')
token = token.copy( 1 ); token = token.copy( 1 );
// cleanup, check if existing:
if (create_ucb_content(
0, expandUnoRcTerm(token),
xCmdEnv, false /* no throw */ )) {
//The file may not exist anymore if a shared or bundled //The file may not exist anymore if a shared or bundled
//extension was removed, but it can still be in the configmgrini. //extension was removed, but it can still be in the configmgrini.
//After running XExtensionManager::synchronize, the configmgrini is //After running XExtensionManager::synchronize, the configmgrini is
//cleaned up //cleaned up
m_xcu_files.push_back( token ); m_xcu_files.push_back( token );
} }
else
{
//Check if it was removed. Only when the file contained %origin, so that
//a new file was writen in the user installation (e.g. $BUNDLED_EXTENSIONS_USER)
//See also ConfigurationBackendDb.iniEntry
::std::list<OUString> iniEntries = getAllIniEntries();
if (::std::find(iniEntries.begin(), iniEntries.end(), token)
!= iniEntries.end())
m_xcu_files.push_back( token );
else
OSL_ENSURE(0, "Extension manager: Invalid configmgr.ini entry.");
}
}
} }
while (index >= 0); while (index >= 0);
} }
@@ -502,6 +481,8 @@ bool BackendImpl::removeFromConfigmgrIni(
{ {
//in case the xcu contained %origin% then the configmr.ini contains the //in case the xcu contained %origin% then the configmr.ini contains the
//url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) //url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER)
//However, m_url (getURL()) contains the URL for the file in the actual
//extension installatation.
::boost::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_); ::boost::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_);
if (data) if (data)
i = std::find(rSet.begin(), rSet.end(), data->iniEntry); i = std::find(rSet.begin(), rSet.end(), data->iniEntry);
@@ -757,11 +738,18 @@ void BackendImpl::PackageImpl::processPackage_(
} }
that->m_registeredPackages->erase(i->first); that->m_registeredPackages->erase(i->first);
} }
try
{
::ucbhelper::Content( ::ucbhelper::Content(
makeURL( that->getCachePath(), OUSTR("registry") ), makeURL( that->getCachePath(), OUSTR("registry") ),
xCmdEnv ).executeCommand( xCmdEnv ).executeCommand(
OUSTR("delete"), Any( true /* delete physically */ ) ); OUSTR("delete"), Any( true /* delete physically */ ) );
} }
catch(Exception&)
{
OSL_ASSERT(0);
}
}
that->deleteDataFromDb(getURL()); that->deleteDataFromDb(getURL());
//TODO: revoking at runtime, possible, sensible? //TODO: revoking at runtime, possible, sensible?