Skip to content

Commit d4d0542

Browse files
committed
Revert "[Build] Restore compressed content.xml for platform repository"
This reverts commit c15c955. Fixes #3188
1 parent 6f4265d commit d4d0542

File tree

4 files changed

+201
-5
lines changed

4 files changed

+201
-5
lines changed

cje-production/promotion/promoteSites.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,87 @@ function addRepoProperties ()
235235
${ECLIPSE_EXE} --launcher.suppressErrors -nosplash -consolelog -debug -data ${devworkspace} -application ${APP_NAME} -vmargs ${MIRRORS_URL_ARG} -Dp2ArtifactRepositoryName="${ART_REPO_NAME}" -Dp2MetadataRepositoryName="${CON_REPO_NAME}" ${ART_REPO_ARG} ${CON_REPO_ARG}
236236
}
237237

238+
function createXZ
239+
{
240+
BUILDMACHINE_SITE=$1
241+
242+
CONTENT_JAR_FILE="${BUILDMACHINE_SITE}/content.jar"
243+
if [[ ! -e "${CONTENT_JAR_FILE}" ]]
244+
then
245+
echo -e "\n\tERROR: content.jar file did not exist at ${BUILDMACHINE_SITE}."
246+
return 1
247+
fi
248+
ARTIFACTS_JAR_FILE="${BUILDMACHINE_SITE}/artifacts.jar"
249+
if [[ ! -e "${ARTIFACTS_JAR_FILE}" ]]
250+
then
251+
echo -e "\n\tERROR: artifacts.jar file did not exist at ${BUILDMACHINE_SITE}."
252+
return 1
253+
fi
254+
255+
# Notice we overwrite the XML files, if they already exists.
256+
unzip -q -o "${CONTENT_JAR_FILE}" -d "${BUILDMACHINE_SITE}"
257+
RC=$?
258+
if [[ $RC != 0 ]]
259+
then
260+
echo "ERROR: could not unzip ${CONTENT_JAR_FILE}."
261+
return $RC
262+
fi
263+
# Notice we overwrite the XML files, if they already exists.
264+
unzip -q -o "${ARTIFACTS_JAR_FILE}" -d "${BUILDMACHINE_SITE}"
265+
RC=$?
266+
if [[ $RC != 0 ]]
267+
then
268+
echo "ERROR: could not unzip ${ARTIFACTS_JAR_FILE}."
269+
return $RC
270+
fi
271+
272+
CONTENT_XML_FILE="${BUILDMACHINE_SITE}/content.xml"
273+
ARTIFACTS_XML_FILE="${BUILDMACHINE_SITE}/artifacts.xml"
274+
# We will check the content.xml and artifacts.xml files really exists. In some strange world, the jars could contain something else.
275+
if [[ ! -e "${CONTENT_XML_FILE}" || ! -e "${ARTIFACTS_XML_FILE}" ]]
276+
then
277+
echo -e "\n\tERROR: content.xml or artifacts.xml file did not exist as expected at ${BUILDMACHINE_SITE}."
278+
return 1
279+
fi
280+
281+
# finally, compress them, using "extra effort"
282+
# Notice we use "force" to over write any existing file, presumably there from a previous run?
283+
XZ_EXE=$(which xz)
284+
if [[ $? != 0 || -z "${XZ_EXE}" ]]
285+
then
286+
echo -e "\n\tERROR: xz executable did not exist."
287+
return 1
288+
fi
289+
echo -e "\n\tXZ compression of ${CONTENT_XML_FILE} ... "
290+
$XZ_EXE -e --force "${CONTENT_XML_FILE}"
291+
RC=$?
292+
if [[ $RC != 0 ]]
293+
then
294+
echo "ERROR: could not compress, using $XZ_EXE -e ${CONTENT_XML_FILE}."
295+
return $RC
296+
fi
297+
298+
echo -e "\tXZ compression of ${ARTIFACTS_XML_FILE} ... "
299+
$XZ_EXE -e --force "${ARTIFACTS_XML_FILE}"
300+
RC=$?
301+
if [[ $RC != 0 ]]
302+
then
303+
echo "ERROR: could not compress, using $XZ_EXE -e ${ARTIFACTS_XML_FILE}."
304+
return $RC
305+
fi
306+
307+
308+
# Notice we just write over any existing p2.index file.
309+
# May want to make backup of this and other files, for production use.
310+
P2_INDEX_FILE="${BUILDMACHINE_SITE}/p2.index"
311+
echo "version=1" > "${P2_INDEX_FILE}"
312+
echo "metadata.repository.factory.order= content.xml.xz,content.xml,!" >> "${P2_INDEX_FILE}"
313+
echo "artifact.repository.factory.order= artifacts.xml.xz,artifacts.xml,!" >> "${P2_INDEX_FILE}"
314+
echo -e "\tCreated ${P2_INDEX_FILE}"
315+
316+
return 0
317+
}
318+
238319
DROP_ID=$(echo $DROP_ID|tr -d ' ')
239320

240321
if [[ -z "${DROP_ID}" ]]
@@ -589,6 +670,7 @@ then
589670
pushd ${LOCAL_REPO}
590671
BUILDMACHINE_SITE=${LOCAL_REPO}/${REPO_ID}
591672
addRepoProperties ${BUILDMACHINE_SITE} ${REPO_SITE_SEGMENT} ${DL_DROP_ID}
673+
createXZ ${BUILDMACHINE_SITE}
592674
mv ${REPO_ID} ${DL_DROP_ID}
593675
scp -r ${LOCAL_REPO}/${DL_DROP_ID} [email protected]:/home/data/httpd/download.eclipse.org/eclipse/updates/${REPO_SITE_SEGMENT}
594676
popd

eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/category.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,4 @@
1919
<bundle id="jakarta.inject.jakarta.inject-api" version="1.0.5"/>
2020
<bundle id="org.eclipse.equinox.slf4j"/>
2121
<bundle id="org.eclipse.debug.terminal"/>
22-
<iu>
23-
<query>
24-
<expression type="match">id == 'org.eclipse.equinox.executable'</expression>
25-
</query>
26-
</iu>
2722
</site>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<xsl:stylesheet
3+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+
version="1.0">
5+
<xsl:output
6+
omit-xml-declaration="yes"
7+
indent="yes" />
8+
<xsl:strip-space elements="*" />
9+
<xsl:template match="/repository/units">
10+
<xsl:copy>
11+
<xsl:apply-templates select="@*|node()" />
12+
<xsl:copy-of select="unit[@id='org.eclipse.equinox.executable.feature.group']" />
13+
</xsl:copy>
14+
</xsl:template>
15+
<xsl:template match="/repository/units/unit[@id='org.eclipse.equinox.executable.feature.group']/@id">
16+
<xsl:attribute name="id">
17+
<xsl:value-of select="'org.eclipse.equinox.executable'" />
18+
</xsl:attribute>
19+
</xsl:template>
20+
<xsl:template
21+
match="/repository/units/unit[@id='org.eclipse.equinox.executable.feature.group']/provides/provided[@name='org.eclipse.equinox.executable.feature.group']/@name">
22+
<xsl:attribute name="name">
23+
<xsl:value-of select="'org.eclipse.equinox.executable'" />
24+
</xsl:attribute>
25+
</xsl:template>
26+
<xsl:template match="/repository/units/unit[@id='org.eclipse.equinox.executable.feature.group']/update/@id">
27+
<xsl:attribute name="id">
28+
<xsl:value-of select="'org.eclipse.equinox.executable'" />
29+
</xsl:attribute>
30+
</xsl:template>
31+
<xsl:template
32+
match="/repository/units/unit[@id='org.eclipse.equinox.executable.feature.group']/properties/property[@name='df_LT.featureName']">
33+
<xsl:copy>
34+
<xsl:attribute name="name">
35+
<xsl:value-of select="'df_LT.featureName'" />
36+
</xsl:attribute>
37+
<xsl:attribute name="value">
38+
<xsl:value-of select="'Eclipse Platform Launcher Executables for Multi-Architecture Builds'" />
39+
</xsl:attribute>
40+
</xsl:copy>
41+
</xsl:template>
42+
<xsl:template
43+
match="/repository/units/unit[@id='org.eclipse.equinox.executable.feature.group']/requires/required[starts-with(@name, 'org.eclipse.equinox.executable_root')]" />
44+
<xsl:template match="@*|node()">
45+
<xsl:copy>
46+
<xsl:apply-templates select="@*|node()">
47+
<!--xsl:sort select="@id|@name"/ -->
48+
</xsl:apply-templates>
49+
</xsl:copy>
50+
</xsl:template>
51+
</xsl:stylesheet>

eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/pom.xml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,74 @@
5252
<includeAllSources>true</includeAllSources>
5353
</configuration>
5454
</plugin>
55+
<plugin>
56+
<artifactId>maven-antrun-plugin</artifactId>
57+
<executions>
58+
<execution>
59+
<id>unpack-content-jar</id>
60+
<phase>package</phase>
61+
<configuration>
62+
<target>
63+
<unjar
64+
src="target/repository/content.jar"
65+
dest="target/repository" />
66+
<delete file="target/repository/content.jar" />
67+
<delete file="target/repository/content.xml.xz" />
68+
</target>
69+
</configuration>
70+
<goals>
71+
<goal>run</goal>
72+
</goals>
73+
</execution>
74+
</executions>
75+
</plugin>
76+
<plugin>
77+
<groupId>org.codehaus.mojo</groupId>
78+
<artifactId>xml-maven-plugin</artifactId>
79+
<executions>
80+
<execution>
81+
<id>generate-extra-iu</id>
82+
<phase>package</phase>
83+
<goals>
84+
<goal>transform</goal>
85+
</goals>
86+
</execution>
87+
</executions>
88+
<configuration>
89+
<transformationSets>
90+
<transformationSet>
91+
<dir>target/repository</dir>
92+
<includes>
93+
<include>content.xml</include>
94+
</includes>
95+
<stylesheet>cp-content.xsl</stylesheet>
96+
</transformationSet>
97+
</transformationSets>
98+
</configuration>
99+
</plugin>
100+
<plugin>
101+
<artifactId>maven-resources-plugin</artifactId>
102+
<executions>
103+
<execution>
104+
<id>copy-extra-iu</id>
105+
<phase>package</phase>
106+
<goals>
107+
<goal>copy-resources</goal>
108+
</goals>
109+
<configuration>
110+
<outputDirectory>${basedir}/target/repository</outputDirectory>
111+
<resources>
112+
<resource>
113+
<directory>${basedir}/target/generated-resources/xml/xslt</directory>
114+
<includes>
115+
<include>content.xml</include>
116+
</includes>
117+
</resource>
118+
</resources>
119+
</configuration>
120+
</execution>
121+
</executions>
122+
</plugin>
55123
<plugin>
56124
<groupId>org.eclipse.tycho.extras</groupId>
57125
<artifactId>tycho-p2-extras-plugin</artifactId>

0 commit comments

Comments
 (0)