Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212866 - mozextension eclass regex incomplete
Summary: mozextension eclass regex incomplete
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
: 202567 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-09 20:57 UTC by Moritz Bechler
Modified: 2010-09-16 13:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for better id handling (mozextension.diff,943 bytes, patch)
2009-08-20 18:06 UTC, Rodrigo Saboya
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Bechler 2008-03-09 20:57:54 UTC
Hi,

we just encountered an issue concerning the allowed values of the em:id field in firefox extensions' install.rdf file. Allowed values are (since FF 1.5) either UUIDs or an e-mail style unique identifier (my_piece_of_software@somecompany.foo). A simple fix is attached (that hopefully does not break other extensions). The right way to do would probably be to use some real XML stuff but that might be overkill. The sed approach will just not work if e.g. the order of the elements is changed - let's hope nobody does that.


--- /usr/portage/eclass/mozextension.eclass	2007-12-20 17:06:06.000000000 +0100
+++ /usr/local/portage/eclass/mozextension.eclass	2008-03-09 21:54:33.000000000 +0100
@@ -48,7 +48,9 @@
 	x="${1}"
 	cd ${x}
 	# determine id for extension
-	emid=$(sed -n -e '/<\?em:id>\?/!d; s/.*\([\"{].*[}\"]\).*/\1/; s/\"//g; p; q' ${x}/install.rdf) || die "failed to determine extension id"
+	emid=$(sed -n 's/^.*<em\:id>\(.*\)<\/em\:id>.*$/\1/p' ${x}/install.rdf | head -n 1)
+
+	test -z "$emid" &&  die "failed to determine extension id"
 	insinto "${MOZILLA_FIVE_HOME}"/extensions/${emid}
 	doins -r "${x}"/* || die "failed to copy extension"
 }
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 21:01:01 UTC
Please don't paste any patches inline; it kills formatting and is unreadable...
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 21:01:25 UTC
*** Bug 202567 has been marked as a duplicate of this bug. ***
Comment 3 Rodrigo Saboya 2009-08-20 18:06:38 UTC
Created attachment 201787 [details, diff]
Patch for better id handling

Attached is a patch to handle different em:ids formats. This doesn't address the issue presented in bug #202567, but solves the issue for "email ids" as specified by Mozilla:

https://developer.mozilla.org/en/Install_Manifests#id

Also, I moved the id retrieval to its own function because I ran into this problem when I was making an ebuild for an extension that deemed necessary to get this id to be used in the install process outside the xpi_install function.

I don't know much about ebuidls / bash / sed, so please review and comment.
Comment 4 Jory A. Pratt gentoo-dev 2010-09-16 13:00:16 UTC
If this is still an issue feel free to ping a mozilla dev on #gentoo-moz and we will be happy to help you.