Fix global extension and theme installation by making sure the path to the

XPI file does no contain a leading "file://" when passed to the extension
manager.

See http://bugzilla.mozilla.org/show_bug.cgi?id=250847 for more details.

Reported by:	ale
This commit is contained in:
Joe Marcus Clarke 2004-07-27 20:51:02 +00:00
parent 2f3d2c4f09
commit 9e94e6497f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=114894
26 changed files with 234 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= thunderbird
PORTVERSION= 0.7.2
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= thunderbird/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= thunderbird
PORTVERSION= 0.7.2
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= thunderbird/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= thunderbird
PORTVERSION= 0.7.2
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= thunderbird/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= thunderbird
PORTVERSION= 0.7.2
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= thunderbird/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${PORTVERSION}

View file

@ -0,0 +1,17 @@
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in.orig Tue Jul 27 15:35:12 2004
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in Tue Jul 27 15:36:02 2004
@@ -1568,9 +1568,14 @@
_checkForGlobalInstalls: function (aPath, aItemType)
{
+ var fPrefix = "file://";
// First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
+ if (aPath.substr(0, fPrefix.length) == fPrefix) {
+ // Strip out the file:// prefix if it exists
+ aPath = aPath.substr(fPrefix.length, aPath.length);
+ }
try {
file.initWithPath(aPath);
}