| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright (c) 2016 IBM Corporation and others. |
| |
| This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License 2.0 |
| which accompanies this distribution, and is available at |
| https://www.eclipse.org/legal/epl-2.0/ |
| |
| SPDX-License-Identifier: EPL-2.0 |
| |
| Contributors: |
| David Williams - initial API and implementation |
| --> |
| |
| <project |
| name="Remove one (packed) IU from repository" |
| default="removeIU" |
| basedir="."> |
| <target name="init"> |
| |
| <!-- |
| The repository directory and IU name can be set here, |
| or passed in as a -D parameter. |
| --> |
| <property |
| name="repoDir" |
| value="/data/httpd/download.eclipse.org/rt/ecf/3.13.1/site.p2" /> |
| <property |
| name="iuName" |
| value="org.apache.hadoop.zookeeper" /> |
| |
| <!-- eol to write better messages --> |
| <property |
| name="eol" |
| value="${line.separator}" /> |
| |
| <!-- The remaining part of 'init' are some sanity checks that proper input provided --> |
| <condition property="repoExists"> |
| <available |
| type="dir" |
| file="${repoDir}" /> |
| </condition> |
| <fail unless="repoExists" /> |
| |
| <!-- |
| We check only one file, artifacts.jar (or artifacts.xml), to make sure is is a simple repo, |
| and that it is writeable. If both exist, this step will fail, but that is an ill-formed repository, |
| so should be corrected in any case. |
| --> |
| <condition property="isWriteable"> |
| <resourcecount |
| when="equal" |
| count="1"> |
| <fileset dir="${repoDir}"> |
| <include name="artifacts.jar" /> |
| <include name="artifacts.xml" /> |
| <writable /> |
| </fileset> |
| </resourcecount> |
| </condition> |
| <fail |
| unless="isWriteable" |
| message=":${eol}${eol}[ERROR]: The repository provided, ${eol} '${repoDir}',${eol} is not writeable or is not a simple p2 repository." /> |
| </target> |
| <target |
| name="removeIU" |
| description="Remove one (packed) IU from repository" |
| depends="init"> |
| <fail |
| unless="iuName" |
| message=":${eol}${eol}[ERROR]: iuName must be provided." /> |
| <fail |
| unless="repoDir" |
| message="${eol}${eol}[ERROR]: repoDir must be provided." /> |
| <echo |
| message="${eol}${eol}[INFO]: Removing the pack200 IU of${eol} ${iuName} from the p2 repository at${eol} '${repoDir}'${eol} " /> |
| |
| |
| <p2.remove.iu> |
| <repository location="file://${repoDir}" /> |
| <!-- |
| Without a version specification, |
| this will remove all versions of packed artifact, |
| which may not be desired. |
| --> |
| <iu |
| id="${iuName}" |
| artifacts="(format=packed)" /> |
| </p2.remove.iu> |
| </target> |
| </project> |