Skip to content

Commit efacec9

Browse files
committed
[Build] Restore compressed content.xml for platform repository
Include the additional IU 'org.eclipse.equinox.executable' directly in the platform P2-repository via the defining 'category.xml'. This avoids the post-processing of the raw 'content.xml' file using an XSL transformation and consequently ensures the 'content.xml' is only provided in compressed form as 'content.jar' and 'content.xml.xz'. Due to the previous post-processing the content.xml was only provided uncompressed, which increases the load on the download-server, slows down metadata downloads and also complicates the RelEng process. Fixes #1912
1 parent 53a75be commit efacec9

File tree

4 files changed

+5
-201
lines changed

4 files changed

+5
-201
lines changed

cje-production/promotion/promoteSites.sh

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -235,87 +235,6 @@ 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-
319238
DROP_ID=$(echo $DROP_ID|tr -d ' ')
320239

321240
if [[ -z "${DROP_ID}" ]]
@@ -670,7 +589,6 @@ then
670589
pushd ${LOCAL_REPO}
671590
BUILDMACHINE_SITE=${LOCAL_REPO}/${REPO_ID}
672591
addRepoProperties ${BUILDMACHINE_SITE} ${REPO_SITE_SEGMENT} ${DL_DROP_ID}
673-
createXZ ${BUILDMACHINE_SITE}
674592
mv ${REPO_ID} ${DL_DROP_ID}
675593
scp -r ${LOCAL_REPO}/${DL_DROP_ID} [email protected]:/home/data/httpd/download.eclipse.org/eclipse/updates/${REPO_SITE_SEGMENT}
676594
popd

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@
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>
2227
</site>

eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/cp-content.xsl

Lines changed: 0 additions & 51 deletions
This file was deleted.

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

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -52,74 +52,6 @@
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>
12355
<plugin>
12456
<groupId>org.eclipse.tycho.extras</groupId>
12557
<artifactId>tycho-p2-extras-plugin</artifactId>

0 commit comments

Comments
 (0)