View | Details | Raw Unified | Return to bug 256430
Collapse All | Expand All

(-)classes/export/generate1.php (+6 lines)
Lines 14-24 Link Here
14
 *    Kit Lo (IBM) - patch, bug 251536, newline char missing after copyright comment on first line
14
 *    Kit Lo (IBM) - patch, bug 251536, newline char missing after copyright comment on first line
15
 *    Kit Lo (IBM) - patch, bug 238580, language packs should not include strings that are marked "non-translatable"
15
 *    Kit Lo (IBM) - patch, bug 238580, language packs should not include strings that are marked "non-translatable"
16
 *    Kit Lo (IBM) - patch, bug 252140, Illegal token characters in babel fragment names
16
 *    Kit Lo (IBM) - patch, bug 252140, Illegal token characters in babel fragment names
17
 *    Antoine Toulme (Intalio, Inc) - patch, bug 256430, Fragments with no host jeopardize Eclipse installation
17
 *******************************************************************************/
18
 *******************************************************************************/
18
19
19
/*
20
/*
20
 * Documentation: http://wiki.eclipse.org/Babel_/_Server_Tool_Specification#Outputs
21
 * Documentation: http://wiki.eclipse.org/Babel_/_Server_Tool_Specification#Outputs
21
 */
22
 */
23
define("METADATA_GENERATOR_LOCATION", "/home/babel-working/eclipse"); // you might want to read this value from a config file. Not sure yet.
22
24
23
ob_start();
25
ob_start();
24
ini_set("memory_limit", "64M");
26
ini_set("memory_limit", "64M");
Lines 415-420 Link Here
415
	fclose($outp);
417
	fclose($outp);
416
418
417
	fwrite($language_pack_links_file, "\n\t</ul>");
419
	fwrite($language_pack_links_file, "\n\t</ul>");
420
	
421
	// now generate the metadata and add the non-greedy tags
422
	system(BABEL_BASE_DIR . "classes/export/runMetadata.sh ". METADATA_GENERATOR_LOCATION . " ${output_dir_for_train} ");
423
	sytem("xsltproc -o ${output_dir_for_train}site.xml " . BABEL_BASE_DIR . "content.xsl ${output_dir_for_train}site.xml");
418
}
424
}
419
echo "Completed generating update site\n";
425
echo "Completed generating update site\n";
420
426
(-)classes/export/content.xsl (+37 lines)
Added Link Here
1
<xsl:stylesheet version="1.0">
2
<xsl:output indent="yes"/>
3
<!-- Copy all elements with their attributes -->
4
5
<xsl:template match="@*|node()">
6
7
<xsl:copy>
8
<xsl:apply-templates select="@*|node()"/>
9
</xsl:copy>
10
</xsl:template>
11
12
<!--
13
 Copy <required> elements belonging to nl feature groups, adding "optional" attribute 
14
-->
15
16
<xsl:template match="unit[contains(@id,'.nl') and contains(@id,'.feature.group')]/requires/required[not(contains(@name,'.feature.jar'))]">
17
18
<xsl:copy>
19
<xsl:copy-of select="@*"/>
20
<xsl:attribute name="optional">true</xsl:attribute>
21
<xsl:apply-templates/>
22
</xsl:copy>
23
</xsl:template>
24
25
<!--
26
 Copy <required> elements belonging to nl plugins, adding "greedy" attribute 
27
-->
28
29
<xsl:template match="unit[contains(@id,'.nl') and not(contains(@id,'.feature.group'))]/requires/required">
30
31
<xsl:copy>
32
<xsl:copy-of select="@*"/>
33
<xsl:attribute name="greedy">false</xsl:attribute>
34
<xsl:apply-templates/>
35
</xsl:copy>
36
</xsl:template>
37
</xsl:stylesheet>
(-)classes/export/runMetadata.sh (+4 lines)
Added Link Here
1
#!/bin/sh
2
3
$1/eclipse -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator -updateSite $2 -site file:$2/site.xml -metadataRepositoryName "Babel language packs update site" -append -reuseP
4
ack200Files -vmargs -Xmx256m

Return to bug 256430