-   Slackware (
-   -   Firefox upgrade script to handle plugins migration and RSS reader patch (

shadowsnipes 03-08-2008 04:11 PM

Firefox upgrade script to handle plugins migration and RSS reader patch
The purpose of this script is to help make upgrading the Slackware Firefox package even more convenient. To do this the script:

1) Copies any plugins under your old Firefox plugins directory to the new plugins directory

2) Optionally allows you to back up and restore /usr/bin/firefox in case you use a custom script there

3) Optionally patches Firefox's FeedConverter.js for you so that you can add RSS feeds to your external feed reader (eg. Akregator) from within Firefox.

You can download the script here.

By default, if no args are given the script will look for the new Firefox package and the FirefoxFeed.patch file in the current directory. To specify where to find the package simply enter it as an argument (eg.
upgradeFirefoxPackage /path/to/mozilla-firefox-

You can also specify where the patch file is (using FEEDPATCH) and if /usr/bin/firefox should be backed up and restored (using BACKUPBIN which defaults to 0, or false).


FEEDPATCH=/path/to/FirefoxFeed.patch BACKUPBIN=1 upgradeFirefoxPackage /path/to/mozilla-firefox-
Since BACKUPBIN is 1 /usr/bin/firefox would be backed up and restored. Please note that if you do this unnecessarily you will most likely end up with /usr/bin/firefox pointing to your old location, so only use this if you have a special symlink or script there. An example of such a script would be one that allows you to automatically choose the correct profile if switching between Firefox 1.5, 2.0, Swiftfox, etc.

About the Plugins:
One of the reasons users put their plugins under /usr/lib/firefox/plugins instead of /usr/lib/mozilla/plugins is because they do not have the seamonkey package installed. If you are one of those users that has plugins under /usr/lib/firefox/plugins then the regular upgradepkg will not do everything you need. Your plugins won't be copied over to the new location and your old Firefox program directory will still be there. This script fixes that by making sure they are copied over and the old Firefox directory is completely deleted.

The RSS Feed patch:
If no readable patch file is found then FeedConverter.js will not be patched. I will repeat that. If you do not want to use the patch then simply do not put the patch file in the working directory and do not specify where to find it. Otherwise, your FeedConverter.js file will be patched and a backup will be created called FeedConverter.js.orig. The patch can be found under my patches directory. You will need to modify some Firefox preferences to make use of the patch. For more information on that please see this thread about Subscribing to RSS Feeds in Firefox 2.0. At a minimum you will have to at least modify browser.feeds.handlers.application in your about:config.

Error Checking:
This script does include error checking to make sure you don't try to run it as a non-root user, upgrade with an older version, upgrade with a regular tar.gz file, etc. The script will confirm before any upgrade is done as well, so it is unlikely you could do anything stupid or dangerous with this script unless you set out to do so. Even so, I encourage you to read the script prior to using it, and you use it at your own risk.

This script will not perform an upgrade if you have installed more than one version of firefox through your package manager (namely more than one is listed under /var/logs/packages/mozilla-firefox*).

One thing this script currently does not check for is if you have other modified files under your old Firefox program directory. This should not be a problem unless you installed global addons or created a global default profile.

Please leave a post if this was helpful to you or if you have any questions, concerns, or comments.


XavierP 03-10-2008 11:29 AM

Excellent script. I have been using FEBE to do similar tasks, though FEBE works via your profile rather than the FF directory.

shadowsnipes 03-10-2008 01:09 PM


Originally Posted by XavierP (Post 3084011)
Excellent script. I have been using FEBE to do similar tasks, though FEBE works via your profile rather than the FF directory.

I'm glad you like the script!

I've head of FEBE before, but I don't think I have ever used it. I have a backup script for my computer that backs up (among many other things) my entire firefox profile. However, if I remember correctly FEBE allows you to backup your addons to individual xpi files or one big xpi file, which makes it convenient to add them to other profiles. You could easily do a similar thing outside of Firefox using a short script. xpi files are basically just zip files, so all you would have to do is zip up the files under the addon folders you want. You can unzip another xpi file to see what they should look like (basically everything under a {*} folder). You could add this to your normal backup routines.

XavierP 03-10-2008 03:32 PM

This is pretty much what FEBE does: it backs everything up to a .fbu file which can be renamed to .zip and used as such. What it does is allow you to set up a scheduled backup from the program itself and also allow you to decide how much or how little you back up.

All times are GMT -5. The time now is 05:15 AM.