LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-08-2008, 04:11 PM   #1
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
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.


Usage:
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-2.0.0.12.tgz).

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).

Example:
Code:
FEEDPATCH=/path/to/FirefoxFeed.patch BACKUPBIN=1 upgradeFirefoxPackage /path/to/mozilla-firefox-2.0.0.12.tgz
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.


Caveats
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.

Enjoy!
 
Old 03-10-2008, 11:29 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Excellent script. I have been using FEBE to do similar tasks, though FEBE works via your profile rather than the FF directory.
 
Old 03-10-2008, 01:09 PM   #3
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by XavierP View Post
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.
 
Old 03-10-2008, 03:32 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tiny Tiny RSS: A very very useful RSS reader LXer Syndicated Linux News 0 05-16-2007 02:46 AM
RSS reader for X? Randux Linux - Software 0 03-21-2006 08:48 PM
rss reader: firefox extension or seperate linux program? shengchieh Linux - Software 7 02-16-2005 06:03 PM
RSS Reader CarnageBox Linux - Software 7 12-16-2004 03:39 PM
RSS Reader downinthemine Linux - Software 2 09-16-2003 08:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration