Am 29.07.2013 um 08:08 schrieb Kornel Benko <kor...@lyx.org>:

> Am Sonntag, 28. Juli 2013 um 19:51:50, schrieb Stephan Witt <st.w...@gmx.net>
> > Am 28.07.2013 um 19:24 schrieb Pavel Sanda <sa...@lyx.org>:
> > 
> > > Jürgen Spitzmüller wrote:
> > >> You could introduce a build flag --inherit-settings or somesuch, then 
> > >> everybody can set what pleases him.
> > > 
> > > +1
> > > 
> > >> 
> > >> Jürgen
>  
> And what should happen, if someone chooses to start lyx with -userdir=xxx?
> In other words, how can one prevent lyx from copying (Suppose, I want clean 
> default start)
>  
> > Ok. But would this be acceptable for LyX 2.1?
> > 
> > Stephan
>  
> Please no. Why not make it a parameter to lyx: "-inherit-settings true", 
> defaulting to false.

Ok. I'll do it for Mac only then.

Regarding your "Why not?": this isn't possible. 
The user double clicks the application icon and
doesn't pass any parameters.

Regarding the surprise effects: the average user would
be surprised in case LyX looses all the user settings
on upgrade from 2.0 to 2.1 - especially on a Mac. The
only solution I can imagine is to copy the preferences.
The safest I can imagine is to copy them early - at the
point when the new user directory is empty. And the easiest
I can imagine is to implement this in configure.py without
touching the LyX binary code.

An additional build flag --inherit-settings is affordable
but only when non-controversial.

I should have given more explanation for the patch at first.
Sorry about that. To summarize the facts what configure.py
after the change is doing to migrate the user directory:

1) Check if the user directory is a new one.
2) Check for the user directory being 'LyX' + version suffix
3) Look for the neighbor user directories 'LyX-2.0' and 'LyX-1.6'
3a) and copying the first matching contents to the new user directory

This effectively works on a Mac only, IMO. Some developers already
pointed out the base name of the user directory on Linux is different.
But to be sure I'll add an "if sys.platform == 'darwin':" making
running on a Mac a prerequisite.

Another prerequisite to enable the copying is the use of 
--with-version-suffix

Stephan

Attachment: 0003-configure-migrate.diff
Description: Binary data

Reply via email to