[Libreoffice-commits] .: 6 commits - android/qa desktop/source sal/osl
Michael Meeks
michael at kemper.freedesktop.org
Tue Jan 24 10:11:35 PST 2012
android/qa/desktop/Makefile | 35 ++++++++++++++++++++++++-----------
desktop/source/app/app.cxx | 5 ++++-
desktop/source/app/userinstall.cxx | 14 ++++++++++++--
sal/osl/unx/security.c | 34 +++++++++++++++++++++++++++++++++-
4 files changed, 73 insertions(+), 15 deletions(-)
New commits:
commit 8b589f50f29031a1e93fc040646f917a7fff7bda
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 18:10:07 2012 +0000
android: extend rc files some more to aid bootstrapping.
it seems there are two 'unorc' files - confusing huh ?
diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile
index 67bc851..09b5fa9 100644
--- a/android/qa/desktop/Makefile
+++ b/android/qa/desktop/Makefile
@@ -33,9 +33,11 @@ buildrcs:
echo "Logo=1" >> assets/program/lofficerc
echo "NativeProgress=1" >> assets/program/lofficerc
echo "URE_BOOTSTRAP=file:///assets/program/fundamentalrc" >> assets/program/lofficerc
- echo "RTL_LOGFILE=file:///dev/log/main" >> assets/program/lofficerc
+# echo "RTL_LOGFILE=file:///dev/log/main" >> assets/program/lofficerc
echo "HOME=$(APP_DATA_PATH)/files" >> assets/program/lofficerc
echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/files" >> assets/program/lofficerc
+# - this looks useful but breaks more than it fixes ...
+# echo "DISABLE_EXTENSION_SYNCHRONIZATION=1" >> assets/program/lofficerc
# fundamentalrc ini ...
echo "[Bootstrap]" > assets/program/fundamentalrc
echo "LO_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc
@@ -45,6 +47,19 @@ buildrcs:
echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway' >> assets/program/fundamentalrc
echo 'URE_MORE_TYPES=file:///assets/ure/share/misc/types.rdb file:///assets/program/types/types.rdb' >> assets/program/fundamentalrc
echo 'URE_MORE_SERVICES=file:///assets/ure/share/misc/services.rdb file:///assets/program/services/services.rdb <$$BRAND_BASE_DIR/program/services>*' >> assets/program/fundamentalrc
+ echo 'BUNDLED_EXTENSIONS=$$BRAND_BASE_DIR/share/extensions' >> assets/program/fundamentalrc
+ echo 'BUNDLED_EXTENSIONS_PREREG=$$BRAND_BASE_DIR/share/prereg/bundled' >> assets/program/fundamentalrc
+ echo 'BUNDLED_EXTENSIONS_USER=$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/bundled' >> assets/program/fundamentalrc
+ echo 'TMP_EXTENSIONS=$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/tmp' >> assets/program/fundamentalrc
+ echo 'SHARED_EXTENSIONS_USER=$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/shared' >> assets/program/fundamentalrc
+ echo 'UNO_SHARED_PACKAGES=$$BRAND_BASE_DIR/share/uno_packages' >> assets/program/fundamentalrc
+ echo 'UNO_SHARED_PACKAGES_CACHE=$$UNO_SHARED_PACKAGES/cache' >> assets/program/fundamentalrc
+ echo 'UNO_USER_PACKAGES=$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/uno_packages' >> assets/program/fundamentalrc
+ echo 'UNO_USER_PACKAGES_CACHE=$$UNO_USER_PACKAGES/cache' >> assets/program/fundamentalrc
+ echo 'PKG_BundledUnoFile=$$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' >> assets/program/fundamentalrc
+ echo 'PKG_SharedUnoFile=$$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' >> assets/program/fundamentalrc
+ echo 'PKG_UserUnoFile=$$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc' >> assets/program/fundamentalrc
+
# unorc ini ...
echo "[Bootstrap]" > assets/program/unorc
echo "URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/unorc
commit 181dd08b1d3a811f66e629ef61b3ac96de3025b7
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 18:09:48 2012 +0000
android: disable bundled extension synchronisation
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 496a8b9..cf648b4 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -605,6 +605,7 @@ void Desktop::Init()
// 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();
@@ -620,6 +621,7 @@ void Desktop::Init()
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,
commit 72a0b0ad0c364a92fb4872fca4bf3aaaeae0977d
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 16:57:11 2012 +0000
android: initialize security data, and use HOME / bootstrap key
diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c
index 5988506..d73111c 100644
--- a/sal/osl/unx/security.c
+++ b/sal/osl/unx/security.c
@@ -38,6 +38,7 @@
#include <osl/security.h>
#include <osl/diagnose.h>
+#include <rtl/bootstrap.h>
#include "osl/thread.h"
#include "osl/file.h"
@@ -105,6 +106,7 @@ static oslSecurityImpl * growSecurityImpl(
n = SIZE_MAX;
}
p = realloc(impl, n);
+ memset (p, 0, n);
}
if (p == NULL) {
free(impl);
@@ -301,7 +303,6 @@ sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirect
return bRet;
}
-
static sal_Bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax)
{
oslSecurityImpl *pSecImpl = (oslSecurityImpl *)Security;
@@ -309,6 +310,37 @@ static sal_Bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszD
if (pSecImpl == NULL)
return sal_False;
+#ifdef ANDROID
+{
+ sal_Bool bRet = sal_False;
+ rtl_uString *pName = 0, *pValue = 0;
+
+ rtl_uString_newFromAscii(&pName, "HOME");
+
+ if (rtl_bootstrap_get(pName, &pValue, NULL))
+ {
+ rtl_String *pStrValue = 0;
+ if (pValue && pValue->length > 0)
+ {
+ rtl_uString2String(&pStrValue, pValue->buffer,
+ pValue->length, RTL_TEXTENCODING_UTF8,
+ OUSTRING_TO_OSTRING_CVTFLAGS);
+ if (pStrValue && pStrValue->length > 0)
+ {
+ sal_Int32 nCopy = SAL_MIN ((sal_Int32)(nMax-1), pStrValue->length);
+ strncpy (pszDirectory, pStrValue->buffer, nCopy);
+ pszDirectory[nCopy] = '\0';
+ bRet = (size_t)pStrValue->length < nMax;
+ }
+ rtl_string_release(pStrValue);
+ }
+ rtl_uString_release(pName);
+ }
+ if (bRet)
+ return bRet;
+}
+#endif
+
/* if current user, check also environment for HOME */
if (getuid() == pSecImpl->m_pPasswd.pw_uid)
{
commit 651803c7a5d4568ade7ca829cfce400090637e38
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 16:56:00 2012 +0000
android: disable lock-file bits for now
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index afa53f6..496a8b9 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1540,6 +1540,7 @@ int Desktop::Main()
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
m_pLockfile.reset( new Lockfile );
+#ifndef ANDROID
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() &&
!rCmdLineArgs.IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning ))
{
@@ -1559,12 +1560,12 @@ int Desktop::Main()
return EXIT_FAILURE;
}
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} GetEnableATToolSupport" );
+#endif
// terminate if requested...
if( rCmdLineArgs.IsTerminateAfterInit() )
return EXIT_SUCCESS;
-
// Read the common configuration items for optimization purpose
if ( !InitializeConfiguration() )
return EXIT_FAILURE;
commit 19d423ab67346c2542a1acea1f485a7c43e2dd90
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 16:54:37 2012 +0000
android: attempt to create presets/ directory, add 'HOME' too.
diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile
index eae96e0..67bc851 100644
--- a/android/qa/desktop/Makefile
+++ b/android/qa/desktop/Makefile
@@ -34,6 +34,7 @@ buildrcs:
echo "NativeProgress=1" >> assets/program/lofficerc
echo "URE_BOOTSTRAP=file:///assets/program/fundamentalrc" >> assets/program/lofficerc
echo "RTL_LOGFILE=file:///dev/log/main" >> assets/program/lofficerc
+ echo "HOME=$(APP_DATA_PATH)/files" >> assets/program/lofficerc
echo "OSL_SOCKET_PATH=$(APP_DATA_PATH)/files" >> assets/program/lofficerc
# fundamentalrc ini ...
echo "[Bootstrap]" > assets/program/fundamentalrc
@@ -177,16 +178,13 @@ copy-stuff: buildrcs
cp -R $(OUTDIR)/bin/images_tango.zip assets/share/config/images.zip
# .res files
cp $(OUTDIR)/bin/*en-US.res assets/program/resource/
-# presets - becomes the users home directory
- mkdir -p assets/presets/autocorr
- mkdir -p assets/presets/autotext
- mkdir -p assets/presets/backup
- mkdir -p assets/presets/basic
- mkdir -p assets/presets/config
- mkdir -p assets/presets/gallery
- mkdir -p assets/presets/psprint
- mkdir -p assets/presets/template
- mkdir -p assets/presets/wordbook
+# presets - becomes the users home directory, .stamp forces .zip dir creation
+ for D in $(strip autocorr autotext backup basic config gallery \
+ psprint/driver psprint/fontmetric template \
+ uno_packages/cache wordbook); do \
+ mkdir -p assets/presets/$$D ; \
+ echo "content" > assets/presets/$$D/stamp; \
+ done
# Then assets that are unpacked at run-time into the app's data directory.
mkdir -p assets/unpack/etc/fonts
cp fonts.conf assets/unpack/etc/fonts
commit b813ff2971ecdfd18962cec0cdf87d3ea2942a81
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Jan 24 14:28:16 2012 +0000
android: disable create_user_install's copyFile goodness
osl_copyFile is not implemented for android yet, and we can pre-can this dir.
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index f91eb1f..72eb8f6 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -159,7 +159,6 @@ namespace desktop {
static osl::FileBase::RC copy_recursive( const rtl::OUString& srcUnqPath, const rtl::OUString& dstUnqPath)
{
-
FileBase::RC err;
DirectoryItem aDirItem;
DirectoryItem::get(srcUnqPath, aDirItem);
@@ -207,6 +206,13 @@ namespace desktop {
// copy single file - foldback
err = File::copy( srcUnqPath,dstUnqPath );
}
+
+#ifdef ANDROID
+ fprintf (stderr, "copy_recursive '%s' to '%s' returns (%d)0x%x\n",
+ rtl::OUStringToOString(srcUnqPath, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(dstUnqPath, RTL_TEXTENCODING_UTF8).getStr(),
+ (int)err, (int)err);
+#endif
return err;
}
@@ -235,7 +241,10 @@ namespace desktop {
File::setAttributes(aUserPath, osl_File_Attribute_OwnWrite| osl_File_Attribute_OwnRead| osl_File_Attribute_OwnExe);
#endif
- // copy data from shared data directory of base installation
+#ifndef ANDROID
+ // as of now osl_copyFile does not work on Android => don't do this.
+
+ // copy data from shared data directory of base installation
for (sal_Int32 i=0; pszSrcList[i]!=NULL && pszDstList[i]!=NULL; i++)
{
rc = copy_recursive(
@@ -251,6 +260,7 @@ namespace desktop {
return UserInstall::E_Creation;
}
}
+#endif
try
{
OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
More information about the Libreoffice-commits
mailing list