ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian M. Savage" <jsav...@fisci.com>
Subject Re: Chmod Ant Workn' :)
Date Mon, 04 Sep 2000 07:18:45 GMT
I don't think that you're looking at the most recent version of Chmod.

Below I enclose the result of running "cvs log Chmod.java" in the directory
jakarta-ant/src/main/org/apache/tools/ant/taskdefs. In addition, I ran "cvs
diff -r1.4 -r1.5 Chmod.java", and sure enough, the changes you are
describing can be seen to be made there. After that the source was changed
considerably, and no longer implements and execute method at all.

I suggest you run the same commands, and compare your output with mine.
Perhaps you are accidently looking at some source code which you got from
somewhere else other than CVS, or somehow checked out an older version.

Julian.

ps. While I'm writing this message, I'd like to ask anyone who has
suggestions for how to create a cvs patch file which includes new source
files which you haven't added with "cvs add" to tell me how it's done. I
can't see a way to make cvs do that. Note, I know about the -N option, but
that only works if you actually do a cvs add, which is all find and good,
until someone else actually commits your patch, and you're left with an
unresolved conflict which (I assume) you have to fix by manually editing
your CVS Entries file.

$ cvs diff -r1.4 -r1.5 Chmod.java
Index: Chmod.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.jav
a,v
retrieving revision 1.4
retrieving revision 1.5
diff -r1.4 -r1.5
75,76c75,76
<     public void setFile(String src) {
<         srcFile = project.resolveFile(src);
---
>     public void setFile(File src) {
>         srcFile = src;
79,80c79,80
<     public void setDir(String src) {
<         srcDir = project.resolveFile(src);
---
>     public void setDir(File src) {
>         srcDir = src;
83c83
<     public void setSrc(String src) {
---
>     public void setSrc(File src) {
111c111
<                         chmod(files[i]);
---
>                         chmod((new File(srcDir,
files[i])).getAbsolutePath());


$ cvs log Chmod.java

RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.jav
a,v
Working file: Chmod.java
head: 1.7
branch:
locks: strict
access list:
symbolic names:
        ANT_11: 1.4
        tomcat_32: 1.2.0.4
        TOMCAT_31_FINAL: 1.2
        TOMCAT_31: 1.2.0.2
        TOMCAT_31_RC1: 1.2
        TOMCAT_31_BETA1: 1.2
        TOMCAT_31_M1: 1.1
        TOMCAT_31_M1_RC1: 1.1
keyword substitution: kv
total revisions: 7;     selected revisions: 7
description:
----------------------------
revision 1.7
date: 2000/08/10 12:51:38;  author: bodewig;  state: Exp;  lines: +1 -1
Updated documentation for <chmod> and removed <chmod>'s src attribute.
----------------------------
revision 1.6
date: 2000/08/01 09:18:39;  author: bodewig;  state: Exp;  lines: +96 -32
Make Chmod extend ExecuteOn instead of MatchingTask.

It now processes all files in parallel and can take multiple filesets
as well as references to patternsets and filesets. See build.xml for
an example.
----------------------------
revision 1.5
date: 2000/07/24 14:01:26;  author: bodewig;  state: Exp;  lines: +6 -6
Chmod didn't work if used as a matching task.
Reported by:    Alex Smith <asmith42@hotmail.com>
----------------------------
revision 1.4
date: 2000/07/06 16:48:13;  author: conor;  state: Exp;  lines: +5 -5
Move to task level logging

This patch removes the concept of currentTarget and currentTask from the
BuildEvents code. To facilitate this I have moved logging to the task
level which now passes a task pointer to the project's log method.

Task level logging may also allow for more fine grained control of logging
in the future.

I have left the Project's log methods public to allow people's custom
tasks to continue to work. In the future these can become private.
----------------------------
revision 1.3
date: 2000/07/04 09:30:21;  author: bodewig;  state: Exp;  lines: +47 -14
Make Chmod a MatchingTask.
Submitted by:   Mariusz Nowostawski <mnowostawski@infoscience.otago.ac.nz>
----------------------------
revision 1.2
date: 2000/02/28 02:17:57;  author: rubys;  state: Exp;  lines: +2 -1
First installment on \x/ill Uther's changes.

While some (like chmod) are clearly Mac motivated, others (like Javac) are
fixes to bugs that can appear on any platform.
Submitted by: William Uther <will+ant@cs.cmu.edu>
----------------------------
revision 1.1
date: 2000/01/13 10:41:41;  author: duncan;  state: Exp;
initial checkin
============================================================================
=

----- Original Message -----
From: "Michael B. Allen" <    >
To: <ant-dev@jakarta.apache.org>
Sent: Monday, September 04, 2000 4:07 PM
Subject: RE: Chmod Ant Workn' :)


> Yup, Delete does the equivalent to the below. Sorry, I don't know much
> about patches and cvs and the like but this should be pretty trivial to
> commit.
>
>         for (int i = 0; i < files.length; i++) {
>             File f = new File(srcDir, files[i]);
>             if(f.exists()) {
>                 chmod(f.toString());
>             }
>         }
>
> Thanks,
> Mike
> Michael_B_Allen@ml.com
> http://jcifs.samba.org
>
>
>
> > -----Original Message-----
> > From: Michael B. Allen [mailto:mballen@erols.com]
> > Sent: Monday, September 04, 2000 2:50 AM
> > To: ant-dev@jakarta.apache.org
> > Subject: RE: Chmod Ant Workn' :)
> >
> >
> > Thanks,
> >
> > Thanks,
> >
> > Are you supposed to prepend the srcDir to the files returned by the
> > directory scanner? The problem is the files[i] are not absolute paths.
> >
> >     public void execute() throws BuildException {
> >         try {
> > <snip>
> >                 } else if(srcFile == null && srcDir != null)
> >
> >
> >                     DirectoryScanner ds = getDirectoryScanner(srcDir);
> >                     String[] files = ds.getIncludedFiles();
> >
> >                     for (int i = 0; i < files.length; i++) {
> > System.out.println( "chmod on " + files[i] );
> >                         chmod(files[i]);
> >                     }
> >                 }
> >             }
> >         } catch (IOException ioe) {
>
>


Mime
View raw message