You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kenneth Rose <an...@kenrose.org> on 2005/11/20 21:12:01 UTC

on

Hi all,

In my build environment, I have a directory containing a bunch of patches.
I would like ant to apply these patches to pristine sources.  I have tried
something similar to:

    <patch dir="pristine">
      <fileset dir="patches">
	<include name="**"/>
        <type type="file"/>
      </fileset>
    </patch>

but I get the error:

The <patch> type doesn't support the nested "fileset" element.

Nuts.  Thinking that the patch command on Unix is a filter, I figured that
I could <concat> all of the patches in a <filterchain> and send the output
to <patch>.  Unfortunately, <patch> does not seem to be a <filterreader>.

I *could* manually specify the patches or I could just <concat> to a
<tempfile>, but both of those solutions are not ideal.  Does anyone know a
way of making <patch> work with a group of patches?

Thanks.

/<en

P.S. - Patches should be applied in alphabetical order based on their
filename.  So if I have:

patches/a_nice_patch.diff
patches/zzz_last_one.diff

then a_nice_patch.diff is applied before zzz_last_one.diff.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: on

Posted by Dominique Devienne <dd...@gmail.com>.
On 11/21/05, Antoine Levy-Lambert <an...@gmx.de> wrote:
> look at the for and for-each constructs of ant-contrib.
>
> :http://ant-contrib.sourceforge.net/

There's no standard way to enforce alphabetical order of files in Ant.
Often the file system will return them in alphabetical order, but there's
no guarantee of that... I had a hack that did that at one point, called
a fileset decorator ;-)

In any case, you may want to also look into <apply>, since I would think
<patch> in fact forks to a system specific patch program.

But for guaranteed order, you may need to write a true (shell?) script
that you exec from Ant.

> Kenneth Rose wrote:
> >P.S. - Patches should be applied in alphabetical order based on their
> >filename.  So if I have:
> >
> >patches/a_nice_patch.diff
> >patches/zzz_last_one.diff
> >
> >then a_nice_patch.diff is applied before zzz_last_one.diff.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: on

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Kenneth,

look at the for and for-each constructs of ant-contrib.

:http://ant-contrib.sourceforge.net/

Cheers,


Antoine

Kenneth Rose wrote:

>Hi all,
>
>In my build environment, I have a directory containing a bunch of patches.
>I would like ant to apply these patches to pristine sources.  I have tried
>something similar to:
>
>    <patch dir="pristine">
>      <fileset dir="patches">
>	<include name="**"/>
>        <type type="file"/>
>      </fileset>
>    </patch>
>
>but I get the error:
>
>The <patch> type doesn't support the nested "fileset" element.
>
>Nuts.  Thinking that the patch command on Unix is a filter, I figured that
>I could <concat> all of the patches in a <filterchain> and send the output
>to <patch>.  Unfortunately, <patch> does not seem to be a <filterreader>.
>
>I *could* manually specify the patches or I could just <concat> to a
><tempfile>, but both of those solutions are not ideal.  Does anyone know a
>way of making <patch> work with a group of patches?
>
>Thanks.
>
>/<en
>
>P.S. - Patches should be applied in alphabetical order based on their
>filename.  So if I have:
>
>patches/a_nice_patch.diff
>patches/zzz_last_one.diff
>
>then a_nice_patch.diff is applied before zzz_last_one.diff.
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org