@@ -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-
319238DROP_ID=$( echo $DROP_ID | tr -d ' ' )
320239
321240if [[ -z " ${DROP_ID} " ]]
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
0 commit comments