//mozilla/common/deploy/deploy_subr |
---|
0,0 → 1,65 |
#!/bin/sh |
# define dirs |
build_dir="$project_dir/build" |
if [ ! -d "$build_dir" ] ; then |
echo "Build dir '$build_dir' not found" >> /dev/stderr |
exit 1 |
fi |
# read meta data |
[ -f "$common_dir/meta.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta.xml") |
[ -f "$common_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta_local.xml") |
[ -f "$project_dir/meta.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta.xml") |
[ -f "$project_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta_local.xml") |
$(xsltproc "$common_dir/id.xsl" "$project_dir/src/install.rdf") |
if [ -z "$META_xpiName" ] ; then |
echo "xpiName not defined in meta.xml" >> /dev/stderr |
exit 2 |
fi |
if [ -z "$META_webDir" ] ; then |
echo "webDir not defined in meta.xml" >> /dev/stderr |
exit 2 |
fi |
if [ -z "$META_keyDir" ] ; then |
echo "keyDir not defined in meta.xml" >> /dev/stderr |
exit 2 |
fi |
if [ -z "$META_spockExec" ] ; then |
echo "spock not defined in meta.xml" >> /dev/stderr |
exit 2 |
fi |
if [ -z "$META_id" ] ; then |
echo "id of the exception is unknown" >> /dev/stderr |
exit 2 |
fi |
# convert paths to abs |
[ -z "${META_keyDir%%/*}" ] || META_keyDir="$project_dir/$META_keyDir" |
[ -z "${META_spockExec%%/*}" ] || META_spockExec="$project_dir/$META_spockExec" |
# cleanup |
rm -f "$build_dir"/* |
(cd "$project_dir/src"; find . -not -path '*/.svn*' | zip -q -@ "$build_dir/$META_xpiName" ) |
xsltproc --stringparam dir "$project_dir" "$common_dir/update.xsl" "$project_dir/src/install.rdf" \ |
> "$build_dir/update.rdf_unsigned" |
"$META_spockExec" "$build_dir/update.rdf_unsigned" -i "urn:mozilla:extension:$META_id" \ |
-d "$META_keyDir" -f "$build_dir/$META_xpiName" \ |
> "$build_dir/update.rdf" \ |
&& rm "$build_dir/update.rdf_unsigned" |
case "$META_deployMethod" in |
scp) |
echo scp "$build_dir/*" "$META_webDir" |
;; |
\*) |
[ -z "${META_webDir%%/*}" ] || META_webDir="$project_dir/$META_webDir" |
echo cp "$build_dir/*" "$META_webDir" |
;; |
esac |
//mozilla/common/deploy/update.xsl |
---|
0,0 → 1,50 |
<?xml version="1.0"?> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> |
<xsl:output indent="yes"/> |
<xsl:param name="dir" /> |
<xsl:variable name="meta" select="document(concat($dir, '/meta.xml'))" /> |
<xsl:template match="/"> |
<r:RDF> |
<xsl:for-each select="r:RDF/r:Description"> |
<xsl:variable name="updateLink"> |
<xsl:value-of select="em:homepageURL" /><xsl:value-of select="$meta//meta/xpiName" /> |
</xsl:variable> |
<r:Description> |
<xsl:attribute name="r:about"> |
<xsl:text>urn:mozilla:extension:</xsl:text> |
<xsl:value-of select="em:id" /> |
</xsl:attribute> |
<em:updates> |
<r:Seq> |
<r:li> |
<r:Description> |
<em:version><xsl:value-of select="em:version" /></em:version> |
<xsl:for-each select="em:targetApplication"> |
<em:targetApplication> |
<r:Description> |
<em:id><xsl:value-of select="r:Description/em:id" /></em:id> |
<em:minVersion><xsl:value-of select="r:Description/em:minVersion" /></em:minVersion> |
<em:maxVersion><xsl:value-of select="r:Description/em:maxVersion" /></em:maxVersion> |
<em:updateLink><xsl:copy-of select="$updateLink" /></em:updateLink> |
</r:Description> |
</em:targetApplication> |
</xsl:for-each> |
</r:Description> |
</r:li> |
</r:Seq> |
</em:updates> |
<em:version><xsl:value-of select="em:version" /></em:version> |
<em:updateLink><xsl:copy-of select="$updateLink" /></em:updateLink> |
<em:updateHash></em:updateHash> |
</r:Description> |
</xsl:for-each> |
</r:RDF> |
</xsl:template> |
</xsl:stylesheet> |
//mozilla/common/deploy/meta.xsl |
---|
0,0 → 1,14 |
<?xml version="1.0"?> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<xsl:output method="text" /> |
<xsl:template match="/meta/*"> |
<xsl:text>export META_</xsl:text> |
<xsl:copy-of select="local-name(.)" /> |
<xsl:text>=</xsl:text> |
<xsl:value-of select="." /> |
<xsl:text> </xsl:text> |
</xsl:template> |
<xsl:template match="text()|@*" /> |
</xsl:stylesheet> |
//mozilla/common/deploy/id.xsl |
---|
0,0 → 1,17 |
<?xml version="1.0"?> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> |
<xsl:output method="text" /> |
<xsl:template match="/r:RDF/r:Description/em:id"> |
<xsl:text>export META_</xsl:text> |
<xsl:copy-of select="local-name(.)" /> |
<xsl:text>=</xsl:text> |
<xsl:value-of select="." /> |
<xsl:text> </xsl:text> |
</xsl:template> |
<xsl:template match="text()|@*" /> |
</xsl:stylesheet> |
//mozilla/common/deploy/. |
---|
Property changes: |
Added: svn:ignore |
+meta_local.xml |