Bug#712040: libreoffice dot dir lacks dot

2013-06-13 Thread Zefram
Rene Engelhard wrote:
>OK, that explains why it's so rerely seen. both KDE and GNOME create stuff 
>under
>.config

Aha.  I can't abide such desktop environments.  I'm old-school: I
use twm, with a minimalist configuration.  Not entirely unrelated to
the fact that I hardly ever run GUI applications such as libreoffice.
(Currently have sixteen windows open, all xterms.)  Needed libreoffice
on this isolated occasion to fill in a form for my employer that was
distributed as a .ods spreadsheet file.

>I guess we should patch this to *always* use .config.

Yeah.  Must create it on demand.

>Not something we can or should do for wheezy, though.

Indeed, stability would seem to preclude any move of the config directory
within the wheezy maintenance track.

-zefram


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#712040: libreoffice dot dir lacks dot

2013-06-13 Thread Rene Engelhard
Hi,

On Thu, Jun 13, 2013 at 11:20:28AM +0100, Zefram wrote:
> Well, that's what it empirically did for me.  Installed via apt-get,
> no manual intervention or configuration, no environment variables set
> specially for libreoffice.

Not here, as said.

> >UserInstallation=$SYSUSERCONFIG/libreoffice/4
> 
> /usr/lib/libreoffice/program/bootstraprc contains the line
> 
>   UserInstallation=$SYSUSERCONFIG/libreoffice/3

sure, cut'n'pasted from my system which has a supported version from 
wheezy-backports installed, doesn't matter for the problem, though.

> >where SYSUSERCONFIG *is* /home/rene/.config here.
> 
> I do not have an environment variable by that name.  Trying out setting

Sure, it#s LO-internal.

> If that sort of setting works for you, maybe that's a v3 vs v4 difference.

Nah.

> That is, it uses ~/.config *if it already exists*, and otherwise just
> uses ~.  So its ultimate default is, as I found, to create files under
> ~/libreoffice.  Creating ~/.config for test purposes, empirically it does
> then get used: ~/.config/libreoffice is created rather than ~/libreoffice.

OK, that explains why it's so rerely seen. both KDE and GNOME create stuff under
.config and so it's there when LO first is ran -> no problem

Otherwise it can be a problem, yeah, I see...

I guess we should patch this to *always* use .config. Not something we can or 
should
do for wheezy, though.

Regards,

Rene


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#712040: libreoffice dot dir lacks dot

2013-06-13 Thread Zefram
Rene Engelhard wrote:
>On Wed, Jun 12, 2013 at 01:20:05PM +0100, Zefram wrote:
>> libreoffice by default creates some files in a directory ~/libreoffice.
>
>No.

Well, that's what it empirically did for me.  Installed via apt-get,
no manual intervention or configuration, no environment variables set
specially for libreoffice.

>UserInstallation=$SYSUSERCONFIG/libreoffice/4

/usr/lib/libreoffice/program/bootstraprc contains the line

UserInstallation=$SYSUSERCONFIG/libreoffice/3

>where SYSUSERCONFIG *is* /home/rene/.config here.

I do not have an environment variable by that name.  Trying out setting
it, using just a pathname (of an existing dir) yields failure at startup:

$ SYSUSERCONFIG=/home/zefram/t1 libreoffice test-document.doc
Xlib:  extension "XINERAMA" missing on display ":0.2".
[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed! 
Warning: failed to read path from javaldx
I18N: Operating system doesn't support locale "en_US"
terminate called after throwing an instance of 
'com::sun::star::uno::RuntimeException'

If that sort of setting works for you, maybe that's a v3 vs v4 difference.

Some parts of the source suggest that it's meant to be a URL, and
that works:

$ SYSUSERCONFIG=file:///home/zefram/t1 libreoffice test-document.doc
Xlib:  extension "XINERAMA" missing on display ":0.2".
I18N: Operating system doesn't support locale "en_US"

Files appear under /home/zefram/t1/libreoffice/3.

Chasing down that "Error in function createSettingsDocument", to see where
SYSUSERCONFIG gets defaulted, leads eventually to osl_psz_getConfigDir()
in sal/osl/unx/security.c.  This has some logic to use XDG_CONFIG_HOME
if it's set, otherwise:

// a default equal to $HOME/.config should be used.
if (!osl_psz_getHomeDir(Security, pszDirectory, nMax))
return sal_False;
n = strlen(pszDirectory);
if (n + sizeof(DOT_CONFIG) < nMax)
{
strncpy(pszDirectory+n, DOT_CONFIG, sizeof(DOT_CONFIG));
if (access(pszDirectory, 0) != 0)
{
// resort to HOME
pszDirectory[n] = '\0';
}
}

That is, it uses ~/.config *if it already exists*, and otherwise just
uses ~.  So its ultimate default is, as I found, to create files under
~/libreoffice.  Creating ~/.config for test purposes, empirically it does
then get used: ~/.config/libreoffice is created rather than ~/libreoffice.

Aside from putting configuration files in the wrong place by default,
this logic will also lose configuration if ~/.config gets created
(perhaps by a different program) after configuration has already been
saved in ~/libreoffice.

-zefram


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#712040: libreoffice dot dir lacks dot

2013-06-12 Thread Rene Engelhard
Hi,

On Wed, Jun 12, 2013 at 01:20:05PM +0100, Zefram wrote:
> libreoffice by default creates some files in a directory ~/libreoffice.

No.

> Conventionally this should by ~/.libreoffice, keeping out of the namespace
> of the user's normal (visible) files.

Which it does normally. See https://wiki.documentfoundation.org/UserProfile:

For GNU/Linux users:

/home//.config/libreoffice/4/user   (LibreOffice 4)
/home//.config/libreoffice/3/user   (LibreOffice 3 since 3.5.0)
/home//.libreoffice/3/user   (prior to LibreOffice 3.5.0)

And indeed, I see

UserInstallation=$SYSUSERCONFIG/libreoffice/4

where SYSUSERCONFIG *is* /home/rene/.config here.

And I see

static const char XDG_CONFIG_PART[] = "/.config";

in the LO 3.5.4 code, followed by:

const char* pXDGCfgHome = getenv("XDG_CONFIG_HOME");
// cater for XDG_CONFIG_HOME change
// If XDG_CONFIG_HOME is set then we;
// assume the user knows what they are doing ( room for improvement 
here, we could
// of course search the default config dir etc. also  - but this is 
more complex,
// we would need to weigh results from the current config dir 
against matches in
// the 'old' config dir etc. ) - currently we just use the returned 
config dir.
// If XDG_CONFIG_HOME is NOT set;
// assume then we should now using the default $HOME/,config config 
location for
// our user profiles, however *all* previous libreoffice and 
openoffice.org
[...]

so this should not happen(tm)...

Regards,

Rene


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#712040: libreoffice dot dir lacks dot

2013-06-12 Thread Zefram
Package: libreoffice
Version: 1:3.5.4+dfsg-4
Severity: minor

libreoffice by default creates some files in a directory ~/libreoffice.
Conventionally this should by ~/.libreoffice, keeping out of the namespace
of the user's normal (visible) files.

-zefram


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org