Closed Bug 931827 Opened 13 years ago Closed 13 years ago

[mozprofile] Better handling of add-on management in case of the 'staged' folder

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(1 file, 1 obsolete file)

I have seen a couple of issues with the removal of installed add-ons because those are not available anymore. I believe that happens because we install add-ons under the extensions/staged folder in the profile. This folder only exists for the installation of add-ons. Once Firefox has been started all add-ons are getting transferred to the main extensions folder. So a later removal should check that folder and not staged.
Blocks: 931828
Attached patch Patch v1 (obsolete) — — Splinter Review
With this patch we change the internal storage of _addons to hold the add-on id and not the vague installation path. That enables us to always find the add-on, whether it was installed by the application or even unpacked during installation. We could make it simpler for sure, but I would propose another bug for that. Something I would like to see is an add-on class which holds all the information of an addon. That should make it way easier. If you agree with that I will file a follow-up bug for it.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #826913 - Flags: review?(ahalberstadt)
Comment on attachment 826913 [details] [diff] [review] Patch v1 Review of attachment 826913 [details] [diff] [review]: ----------------------------------------------------------------- ::: mozprofile/mozprofile/addons.py @@ +64,5 @@ > + path += '.xpi' > + if not os.path.exists(path): > + path = os.path.join(self.profile, 'extensions', 'staged', addon_id) > + if not os.path.exists(path): > + path += '.xpi' I'd prefer a "for p in paths: if os.path.exists(p): return p" model so we don't test for existence more than we need to. I guess this is fine though. @@ +299,5 @@ > + # removed by Profile.cleanup(). So ignore failures for now. > + try: > + self.remove_addon(addon) > + except IOError, e: > + pass The comment makes it seem like this is always the case
Attachment #826913 - Flags: review?(ahalberstadt) → review+
(In reply to Andrew Halberstadt [:ahal] from comment #2) > I'd prefer a "for p in paths: if os.path.exists(p): return p" model so we > don't test for existence more than we need to. I guess this is fine though. Oh, that's right. I will make this change. Thanks for the pointer. > > + # removed by Profile.cleanup(). So ignore failures for now. > > + try: > > + self.remove_addon(addon) > > + except IOError, e: > > + pass > > The comment makes it seem like this is always the case Mostly each time at the moment, yes. Bug 934484 is really annoying and we should get this fixed. If you have feedback for it please reply over there. Thanks.
Attached patch Patch v2 — — Splinter Review
Andrew, please have a look again if that makes sense. Just for sanity.
Attachment #826913 - Attachment is obsolete: true
Attachment #826972 - Flags: review?(ahalberstadt)
Comment on attachment 826972 [details] [diff] [review] Patch v2 Review of attachment 826972 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, looks good!
Attachment #826972 - Flags: review?(ahalberstadt) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: