Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 64607 - Thunderbird profile should be stored in ~/.mozilla/thunderbird for uniformity with firefox
Summary: Thunderbird profile should be stored in ~/.mozilla/thunderbird for uniformity...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Mozilla Gentoo Team
URL: https://bugzilla.mozilla.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-19 02:29 UTC by Matteo Settenvini
Modified: 2004-11-16 13:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
thunderbird-base-userdir.patch (thunderbird-base-userdir.patch,546 bytes, patch)
2004-09-21 02:03 UTC, Matteo Settenvini
Details | Diff
Patch to the ebuild (mozilla-thunderbird-0.8.ebuild.patch,1.45 KB, patch)
2004-09-21 05:46 UTC, Matteo Settenvini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Settenvini 2004-09-19 02:29:51 UTC
Just a trivial issue: Firefox profile is stored in ~/.mozilla/firefox, so Thunderbird one should be stored in ~/.mozilla/thunderbird instead of ~/.thunderbird for uniformity.

Afaik, this can be done by passing "--with-user-appdir=.mozilla/thunderbird" to Thunderbird configuration, and by moving the already present user profiles (if existant) to that dir.

I purpose to add this directly to the eclass, calling explicitly "--with-user-appdir=.mozilla/firefox" also for Firefox (so we'll be sure it won't change position with a version change).

For the profile directory move, we can else just print a warning at the end of the ebuild and the users will do it manually.
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2004-09-20 11:19:31 UTC
Thunderbird's configure script aborts if the path contains any slashes.
Comment 2 Matteo Settenvini 2004-09-20 13:56:53 UTC
What error, exactly?
If possible, we could always patch it.
Comment 3 Harald van Dijk (RETIRED) gentoo-dev 2004-09-20 22:32:58 UTC
From the configure script:

# Check whether --with-user-appdir or --without-user-appdir was given.
if test "${with_user_appdir+set}" = set; then
  withval="$with_user_appdir"
   val=`echo $withval`
if echo "$val" | grep "\/" >/dev/null; then
    { echo "configure: error: "Homedir must be single relative path."" 1>&2; exit 1; }
else 
    MOZ_USER_DIR="$val"
fi
fi

It's not just some error, it's an explicit check that I would expect was put in for a good reason. (No, I don't know what that reason is.)
Comment 4 Matteo Settenvini 2004-09-21 01:59:22 UTC
Which is strange, because exactly the same check is in firefox, but it ends up putting its profile dir in ~/.mozilla/firefox. So I expected that this is the default behaviour coded somewhere in the sources.

In fact, after a quick grep (for Firefox), it appears that browser/app/Makefile.in contains: 
line 220:
       -e "s|%MOZ_USER_DIR%|.mozilla/firefox|" \

Then, explicit check or not, the default the programmers thought about was with a subdir inside it. Then I checked Thunderbird:

mail/app/Makefile.in:  
    -e "s|%MOZ_USER_DIR%|.thunderbird|" \

So I'm gonna try to patch it and rebuild it. If successful, I'll tell you and we can integrate the small patch in Gentoo (if you want, of course).
Comment 5 Matteo Settenvini 2004-09-21 02:03:26 UTC
Created attachment 40062 [details, diff]
thunderbird-base-userdir.patch

I'll attach a modified ebuild later.
Comment 6 Matteo Settenvini 2004-09-21 05:46:25 UTC
Created attachment 40068 [details, diff]
Patch to the ebuild

The patch for the ebuild is ok, but the patch I posted before to the Makefile
isn't.

After finishing compiling it, /usr/lib/MozillaThunderbird/thunderbird contains
the right line with MOD_USER_DIR, so the patch produced a correctly modified
build. However, it doesn't start correctly, so probably there is some problem
elsewhere in the code.

I'll need to investigate further.
Comment 7 Matteo Settenvini 2004-09-21 06:02:22 UTC
Ah, a thing not related to this bug, but I bumped across it and it's trivial so you could fix it without opening a new report:

In installed file /usr/bin/thunderbird:

# Workaround thunderbird needing -a Thunderbird
  # See http://bugzilla.mozilla.org/show_bug.cgi?id=247754
  if [[ $zero == thunderbird ]]; then
    fgrep -q '"0.7"' ${MOZILLA_FIVE_HOME}/defaults/pref/thunderbird.js \
      && zero=Thunderbird
  fi

Should be:
    fgrep -q '"0.7"' ${MOZILLA_FIVE_HOME}/defaults/pref/all-thunderbird.js \
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2004-09-21 06:09:15 UTC
Firefox uses .mozilla as its default user-appdir, not .mozilla/firefox. It adds firefox to it somewhere else. (According to the configure script, that is. What you found suggests that the user-appdir switch is ignored, which doesn't make much sense to me.) It also uses other files and directories in .mozilla (.mozilla/plugins, for example).

PS: Might Thunderbird not work if you don't yet have a .mozilla directory? Will it be able to figure out to create .mozilla before creating .mozilla/thunderbird?
Comment 9 Matteo Settenvini 2004-09-21 06:21:38 UTC
As per comment #4, firefox does the same thing. the default MOZ_USER_DIR is .mozilla for both thunderbird and firefox, but if it isn't set explicitly by the configure with --with-user-appdir=[..] (and in gentoo it isn't), a sed is performed in both apps.

The fact that firefox can create more than a dir deep and thunderbird cannot, as you suggest, is unlikely but possible, imho. But, having applied the patch, at least I should obtain an error, not the old ".thunderbird" created. So I don't think this is the case.

I filed a bug also in bugzilla.mozilla.org. let's see if i get any further info.
Comment 10 Harald van Dijk (RETIRED) gentoo-dev 2004-09-21 06:39:24 UTC
Right, sorry, my mistake. Thunderbird's default in the configure script does indeed seem to be .mozilla.

But I wasn't suggesting that Firefox knows how to create more than one directory deep, while Thunderbird doesn't. What I thought was that when Firefox tries to create .mozilla/firefox, it could succeed because it had to create .mozilla anyway for the other files it uses (meaning it would fail if it used .mozilla/subdir/firefox, as an example), while Thunderbird has no reason to create .mozilla first.

And if my previous comments sounded too negative: I personally do like your idea, and if you get it working I know it's what I'll use, even if for whatever reason it won't get in portage.
Comment 11 Matteo Settenvini 2004-09-21 06:54:52 UTC
>  it had to create .mozilla anyway for the other files it uses 

What files? I previously tried to compile a firefox copy fetched from cvs (since I was looking forward a patch merged before the official mozilla.org next release) and gave "--with-user-appdir=.firefoxcvs" to the configure.

If I remember correctly, I started it in a fresh account and no ~/.mozilla dir was created, while ~/.firefoxcvs appeared. I could be wrong, anyway, I did it a couple of months ago. :p

> And if my previous comments sounded too negative: I personally do like your idea, and if you get it working I know it's what I'll use, even if for whatever reason it won't get in portage.

No problem. Friends? :D
Comment 12 Harald van Dijk (RETIRED) gentoo-dev 2004-09-21 07:07:35 UTC
Cool :)

My .mozilla contains appreg (file), firefox (directory), mozver.dat (file) and plugins (directory). I haven't installed Mozilla, and mozver.dat contains references to Firefox. Firefox used to use .firefox (IIRC) instead of .mozilla/firefox; do you know if your snapshot was from before or after that change?
Comment 13 Matteo Settenvini 2004-09-21 07:33:40 UTC
heh, this is still more interesting.

of:
appreg (file), firefox (directory), mozver.dat (file) and plugins (directory),

i have just:
firefox (directory) and appreg (file)

removing appreg and starting firefox doesn't raise any problem, and it is not re-created. Maybe they're related to installing new extensions?

If this is the case, having a ~/.mozilla "super-dir" above firefox and thunderbird (and sunbird...) makes still more sense: all the plugins are moved from the firefox/otherapp profile to a more neutral dir (i.e. easily rm-able if something goes wrong). Just speculating, though.

Anyway, I grepped through the source extensively, and i wasn't able to find any reason why the patch above wouldn't work. I should take a closer look at the code, but after all the MOZ_USER_DIR var is set dinamically in the "thunderbird" installed shell file (try to "vim /usr/lib/MozillaThunderbird/thunderbird"). I didn't find any hardcoded reference, so it's possible that is the ONLY reference put there by the mozilla build process, and thus the patch worked for what it had to do. The problem is: why does it still create ~/.thunderbird? Evil.
Any volunteer for manually compiling thunderbird with the patch? ;)

(remember to do a "MOZ_THUNDERBIRD=1 ./configure && make")
Comment 14 Harald van Dijk (RETIRED) gentoo-dev 2004-09-21 08:00:35 UTC
Being able to share plugins with Mozilla sounds like reason enough to me, even if it would make them *harder* to remove :)

A grep -R \\.thunderbird /usr/lib/MozillaThunderbird showed only the thunderbird script, exactly what you found. I also searched in the jar files, but found nothing in those either.
Comment 15 Aron Griffis (RETIRED) gentoo-dev 2004-11-16 13:23:03 UTC
Thanks for looking into this.  I'd rather wait for thunderbird upstream to make this change themselves.  There's no driving reason to do it at the distribution level.  Since firefox made the switch voluntarily, I suspect we'll see thunderbird do it eventually as well.