Closed
Bug 900154
Opened 11 years ago
Closed 7 years ago
Mozprofile AddonManger's cleanup() method needs fixing
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: ffledgling, Unassigned)
Details
Currently mozprofile's cleanup() doesn't remove installed .xpi addons after calling cleanup().
To reproduce run:
=======================================================
#!/usr/bin/env python
import mozprofile
import addon_stubs
addon_one = addon_stubs.generate_addon('empty-0-1.xpi')
addon_two = addon_stubs.generate_addon('another-empty-0-1.xpi')
p = mozprofile.profile.FirefoxProfile(addons=addon_one)
# empty-0-1.xpi is installed at this point.
profile = mozprofile.profile.FirefoxProfile(profile=p.profile, addons=addon_two, restore=True)
# Both empty-0-1.xpi and another-empty-0-1.xpi should be installed at this point.
profile.cleanup()
# another-empty-0-1.xpi should be uninstalled now.
print profile #Check if it is.
# Result: it's still there.
Reporter | ||
Comment 1•11 years ago
|
||
I've been looking into this a bit, and it seems proper clean-up is a little difficult atm.
Right now xpi files installed aren't cleaned up because the addons in self.installed_addons aren't deleted at all, and that is the only place where the list of installed addons is stored.
(ref: https://github.com/mozilla/mozbase/blob/master/mozprofile/mozprofile/addons.py#L251-L255 )
Another issue that crops up with this is that, since AddonManager doesn't keep track of the details of the addons installed, it's hard/impossible to do a few things right now:
1) Distinguish b/w addons inherited from the pre-existing profile, and add-ons installed by the current AddonManager class.
This happens because we store name of the .xpi used to install the addon, whereas what we can see using the profile is the addon's id and not the name of the xpi used to install it, there is no necessary co-relation b/w the two, making it hard to map one to the other.
2) Distinguish b/w various versions of an installed addons, for example to check if Bug 759594 works.
Point 1) mentioned above prevents proper cleanup, because if we cannot distinguish b/w addons installed by the current AddonManger class and pre-installed addons, and simply delete all extensions under profile-path/extensions/staged we risk deleting the pre-installed extensions, which is probably not what we want.
I suggest storing the details of the addons, instead of the the name of the original xpi used for install, which doesn't prove to be of much use because by the time we reach the cleanup stage the actual .xpi doesn't exist either and we can't extract any information/details out of that either.
(ref: https://github.com/mozilla/mozbase/blob/master/mozprofile/mozprofile/addons.py#L241-L243 )
Thoughts/Suggestions/Critique?
Flags: needinfo?(ahalberstadt)
Comment 2•11 years ago
|
||
Yeah, I think that proposal is sound. If you feel like working on this, that's great :). Otherwise I wouldn't let this issue block you on your other work too much. Maybe ignore testing the cleanup part (or write a test and skip it by referencing this bug).
Flags: needinfo?(ahalberstadt)
Comment 3•7 years ago
|
||
Mass closing bugs with no activity in 2+ years. If this bug is important to you, please re-open.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•