bad attempt at getting file properties remotely

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion committed 2003-03-18 06:39:59 +00:00
1 parent 3c6c4b3b6c
commit 9e878a32bd
1 file changed
+61 -6
+61 -6
View File
@@ -80,6 +80,32 @@
</repository:exec>
</define:tag>
<!--
! test if a file exists in the remote repo
! @param name the file to check
! @param var the variable to set to true or false
!-->
<define:tag name="fileExists">
<exec dir="." executable="${maven.ssh.executable}" resultproperty="result">
<arg line='-l ${maven.username} ${maven.repo.central} "test -f ${name}"'/>
</exec>
<ant:echo>Result from ssh is '${result}'</ant:echo>
<j:set var="${var}" scope="parent" value="${result == '0'}"/>
</define:tag>
<!--
! test if a directory exists in the remote repo
! @param name the directory to check
! @param var the variable to set to true or false
!-->
<define:tag name="directoryExists">
<exec dir="." executable="${maven.ssh.executable}" resultproperty="result">
<arg line='-l ${maven.username} ${maven.repo.central} "test -d ${name}"'/>
</exec>
<ant:echo>Result from ssh is '${result}'</ant:echo>
<j:set var="${var}" scope="parent" value="${result == '0'}"/>
</define:tag>
<!--
! place the file name portion of a url into a variable
! @param url the URL to process
@@ -134,15 +160,26 @@
! run ssh to create each <groupId>/licenses directory.
!-->
<repository:required name="directoryName" value="${directoryName}" />
<repository:parseAudit var="audit"/>
<!-- see if the user specified a starting project -->
<j:set var="processing" value="true" />
<j:if test="${!empty(startProject)}">
<j:set var="processing" value="false"/>
</j:if>
<x:forEach var="group" select="$audit/licenses/project/groupId">
<j:set var="directory"
value="${maven.repo.central.directory}/${group.text}/${directoryName}" />
<echo>Ensuring directory '${directory}' exists</echo>
<repository:exec
command="mkdir -p ${directory};chmod g+ws ${directory};chgrp ${maven.repository.group} ${directory};" />
<echo>Processing project ${group.text}</echo>
<j:if test="${!processing and group.text.equals(startProject)}">
<j:set var="processing" value="true"/>
</j:if>
<j:if test="${processing}">
<j:set var="directory"
value="${maven.repo.central.directory}/${group.text}/${directoryName}" />
<echo>Ensuring directory '${directory}' exists</echo>
<repository:exec
command="mkdir -p ${directory};chmod g+ws ${directory};chgrp ${maven.repository.group} ${directory};" />
</j:if>
</x:forEach>
</goal>
@@ -257,6 +294,24 @@
</x:forEach>
</goal>
<goal name="repository:audit-copy-poms"
description="">
<repository:directoryExists var="central"
name="${maven.repo.central.directory}" />
<ant:echo>central = '${central}'</ant:echo>
<repository:fileExists var="ant151"
name="${maven.repo.central.directory}/ant/jars/ant-1.5.1.jar" />
<ant:echo>ant151 = '${ant151}'</ant:echo>
<repository:directoryExists var="badcentral"
name="${maven.repo.central.directory}/grunk" />
<ant:echo>badcentral = '${badcentral}'</ant:echo>
<repository:fileExists var="ant171"
name="${maven.repo.central.directory}/ant/jars/ant-1.7.1.jar" />
<ant:echo>ant171 = '${ant171}'</ant:echo>
</goal>
<goal name="repository:audit-generate-poms"
description="generate a pom for all the groupId's in the audit file">