You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jeff Turner <je...@socialchange.net.au> on 2001/12/27 08:56:52 UTC

[OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

(Cc'ing ant-dev for thread continuity.. please don't reply there:)


Incidentally, 'diff -N' is not a general, nor cross-platform, solution
to the problem of how to convey updates.

I'd like to invent one though :) I was thinking along the lines of a
.jar file containing updates, with an Ant script, META-INF/control.xml,
which describes how the contents of the jar must be applied.

Basically, a jar file that knows what to do with itself. Much like an
RPM or .deb file.

These jars are 'applied' to a system by running another Ant script,
which:

 - optionally fetches the jar via a HTTP GET.
 - verifies the jar signature
 - unpacks the jar, and transfers control to META-INF/control.xml,
   which:
   - Ensures that the files to be replaced/patched validate against a
     MD5 checksum (to be sure we're not overwriting modifications)
   - If they do, replace/patch/remove them.
   - Optionally do things like restart Tomcat, if the updates are for a
     website.
 - Control then passes back to the invoking script, which cleans up.


My primary use-case is that of distributing updates to a client-managed
website. Each 'update' consists of new/modified jars, a few JSPs, and
perhaps a web.xml modification. These can't be done via CVS because
they're behind a firewall, and can't be done with 'diff', because
they're on WinNT. Hence the need for a cross-platform mechanism for
applying self-contained updates.


Anyone know of something like this, or a better solution? If anyone's
interested, I have a prototype (without the jar signature verification
or MD5 checksumming), and would be happy to collaborate further in the
development of such a system.


--Jeff


On Thu, Dec 27, 2001 at 05:38:48PM +1100, Jeff Turner wrote:
> On Wed, Dec 26, 2001 at 08:36:15PM -0600, Steve Cohen wrote:
> > What is the best way for someone not a committer to submit a totally new
> > file for the ant CVS repository?  Last time I did this, I just sent it
> > an an attachment with the bug report I'd submitted.  
> > 
> > However, this seems like a kludgey way to go about it.  Ideally, it
> > seems to me, a new file should fit into the CVS patch file the way
> > anything else does.  But of course, since you haven't checked it out,
> > CVS knows nothing about it and cvs diff won't work.  Is there a way to
> > get this into the patches file?  Or is sending it as a separate
> > attachment the only way?
> 
> One way is to:
> 
> a) get the cvsutils scripts from http://www.red-bean.com/cvsutils/.
>    Worth getting anyway. I don't know what I'd do without 'cvsco' :)
> 
> b) Do a 'cvsdo add <file>', which modifies CVS/Entries to mark the file
> as new (without contacting the server).
> 
> c) Generate the diff with 'cvs -RuN' (Recursion, unified, New files).
> 'man diff' says:
> 
>   -N
>   --new-file
>      In directory comparison, if a file is found in only one directory,
>      treat it as present but empty in the other directory.
> 
> 
> I can add this to the task guidelines if it's not deemed to hackish :)
> 
> 
> --Jeff
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Sv: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

Posted by Max <ma...@eos.dk>.
Have you looked at Java Webstart ?

It has things like jar-diffs, version-checking, automatic download etc. - you might use some of that.

With hope
 Max

----- Original Message ----- 
From: Jeff Turner <je...@socialchange.net.au>
To: <an...@jakarta.apache.org>
Cc: Ant Developers List <an...@jakarta.apache.org>
Sent: Thursday, December 27, 2001 8:56 AM
Subject: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)


> (Cc'ing ant-dev for thread continuity.. please don't reply there:)
> 
> 
> Incidentally, 'diff -N' is not a general, nor cross-platform, solution
> to the problem of how to convey updates.
> 
> I'd like to invent one though :) I was thinking along the lines of a
> .jar file containing updates, with an Ant script, META-INF/control.xml,
> which describes how the contents of the jar must be applied.
> 
> Basically, a jar file that knows what to do with itself. Much like an
> RPM or .deb file.
> 
> These jars are 'applied' to a system by running another Ant script,
> which:
> 
>  - optionally fetches the jar via a HTTP GET.
>  - verifies the jar signature
>  - unpacks the jar, and transfers control to META-INF/control.xml,
>    which:
>    - Ensures that the files to be replaced/patched validate against a
>      MD5 checksum (to be sure we're not overwriting modifications)
>    - If they do, replace/patch/remove them.
>    - Optionally do things like restart Tomcat, if the updates are for a
>      website.
>  - Control then passes back to the invoking script, which cleans up.
> 
> 
> My primary use-case is that of distributing updates to a client-managed
> website. Each 'update' consists of new/modified jars, a few JSPs, and
> perhaps a web.xml modification. These can't be done via CVS because
> they're behind a firewall, and can't be done with 'diff', because
> they're on WinNT. Hence the need for a cross-platform mechanism for
> applying self-contained updates.
> 
> 
> Anyone know of something like this, or a better solution? If anyone's
> interested, I have a prototype (without the jar signature verification
> or MD5 checksumming), and would be happy to collaborate further in the
> development of such a system.
> 
> 
> --Jeff
> 
> 
> On Thu, Dec 27, 2001 at 05:38:48PM +1100, Jeff Turner wrote:
> > On Wed, Dec 26, 2001 at 08:36:15PM -0600, Steve Cohen wrote:
> > > What is the best way for someone not a committer to submit a totally new
> > > file for the ant CVS repository?  Last time I did this, I just sent it
> > > an an attachment with the bug report I'd submitted.  
> > > 
> > > However, this seems like a kludgey way to go about it.  Ideally, it
> > > seems to me, a new file should fit into the CVS patch file the way
> > > anything else does.  But of course, since you haven't checked it out,
> > > CVS knows nothing about it and cvs diff won't work.  Is there a way to
> > > get this into the patches file?  Or is sending it as a separate
> > > attachment the only way?
> > 
> > One way is to:
> > 
> > a) get the cvsutils scripts from http://www.red-bean.com/cvsutils/.
> >    Worth getting anyway. I don't know what I'd do without 'cvsco' :)
> > 
> > b) Do a 'cvsdo add <file>', which modifies CVS/Entries to mark the file
> > as new (without contacting the server).
> > 
> > c) Generate the diff with 'cvs -RuN' (Recursion, unified, New files).
> > 'man diff' says:
> > 
> >   -N
> >   --new-file
> >      In directory comparison, if a file is found in only one directory,
> >      treat it as present but empty in the other directory.
> > 
> > 
> > I can add this to the task guidelines if it's not deemed to hackish :)
> > 
> > 
> > --Jeff
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

Posted by Jeff Turner <je...@socialchange.net.au>.
On Thu, Dec 27, 2001 at 08:13:34PM +0100, Nico Seessle wrote:
> ----- Original Message -----
> From: "Jeff Turner" <je...@socialchange.net.au>
> To: <an...@jakarta.apache.org>
> Cc: "Ant Developers List" <an...@jakarta.apache.org>
> Sent: Thursday, December 27, 2001 8:56 AM
> Subject: [OT] Ant-driven update system (Re: Best way to add file to CVS
> repository?)
> 
> 
> > Incidentally, 'diff -N' is not a general, nor cross-platform, solution
> > to the problem of how to convey updates.
> 
> Do you know a plattform where cvs is not available? I've even found
> references to ports to AS/400 and MVS that are in the works.

But it's not on 80% of the boxes that websites get deployed to. Nor
would it be any use on those boxes, as they're behind firewalls.

But my problem isn't with CVS, but with the inadequacy of 'diff' as the
sole way of conveying updates. Diffs can't convey the information "this
file was deleted", They can convey "this file was added", but only as a
hack which is inappropriate for binary files like jars, and rarely used
in practice.

> > I'd like to invent one though :) I was thinking along the lines of a
> > .jar file containing updates, with an Ant script, META-INF/control.xml,
> > which describes how the contents of the jar must be applied.
> 
> There are other people inventing replacements for cvs, for example
> http://subversion.tigris.org which should also work thru firewalls as it
> uses WebDAV for repository access.

Subversion is going to totally rock :) I hope Apache is one of the first
to switch from CVS.

Subversion's "tree delta" is most relevant here:

  "A tree delta describes changes between two directory trees, the
  source tree and the target tree. Tree deltas can describe copies,
  renames, and deletions of files and directories, changes to file
  contents, and changes to property lists. 

  ...

  A tree delta is a list of changes of the form

  <tree-delta>change...</tree-delta>
  which describe how to edit the contents of source-dir to yield
  target-dir. There are three kinds of changes:

  <delete name='name'/>
   Source-dir has an entry named name, which is not present in
   target-dir.

  <add name='name'>content</add>
   target-dir has an entry named name, which is not present in
   source-dir; content describes the file or directory to which the
   new directory entry refers.

  <replace name='name'>content</replace>
   Both source-dir and target-dir have an entry named name, which
   has changed; content describes the new file or directory."

   -- http://www.tigris.org/files/documents/15/48/svn-design.html


Now don't those <delete>, <add> and <replace> tasks seem awfully similar
to Ant's <delete>, <copy> and <move>?

So for my purposes (updating websites), Subversion deltas would be
better in the long run, but I think I can do an equivalent job with Ant.
Because it's based on Java, it's cross-platform, and Subversion "blue
sky items" like digital signatures are possible right now (jar
signing).

> > Basically, a jar file that knows what to do with itself. Much like an
> > RPM or .deb file.
> 
> Can you deliver *patches* with rpm or deb-packages? I always thought they
> would always contain the complete package and - maybe - now how to update an
> older installation if there is one avaialble. But you always need to
> distribute the whole package, don't you?

Not sure.. I don't think so. They're just archives ('ar' and 'tar' in
the case of .debs) with metadata and shell scripts telling the host
system what to do with the files.

> Okay, but what you are describing is really a system to patch distibuted
> software, isn't it? Personally, I don't think that a project which aims to
> be "a Java based build tool" should care about patching your installations.
> Maybe a task to create such a patch would be nice to have in Ant, but the
> invention of the complete patch-system goes beyond the target of Ant.

Who says Ant most _only_ be a "Java based build tool"? ;) I want to use
Ant as a "cross-platform scripting language". Ovidiu Predescu and I are
using Ant as a "functional testing tool"..

I can't wait till Ant 2 arrives.. hopefully the distinction between
"ant-core", and "ant-the-build-tool" will become much clearer.

--Jeff

> Nico

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "Jeff Turner" <je...@socialchange.net.au>
To: <an...@jakarta.apache.org>
Cc: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Thursday, December 27, 2001 8:56 AM
Subject: [OT] Ant-driven update system (Re: Best way to add file to CVS
repository?)


> Incidentally, 'diff -N' is not a general, nor cross-platform, solution
> to the problem of how to convey updates.

Do you know a plattform where cvs is not available? I've even found
references to ports to AS/400 and MVS that are in the works.

> I'd like to invent one though :) I was thinking along the lines of a
> .jar file containing updates, with an Ant script, META-INF/control.xml,
> which describes how the contents of the jar must be applied.

There are other people inventing replacements for cvs, for example
http://subversion.tigris.org which should also work thru firewalls as it
uses WebDAV for repository access.

> Basically, a jar file that knows what to do with itself. Much like an
> RPM or .deb file.

Can you deliver *patches* with rpm or deb-packages? I always thought they
would always contain the complete package and - maybe - now how to update an
older installation if there is one avaialble. But you always need to
distribute the whole package, don't you?

Okay, but what you are describing is really a system to patch distibuted
software, isn't it? Personally, I don't think that a project which aims to
be "a Java based build tool" should care about patching your installations.
Maybe a task to create such a patch would be nice to have in Ant, but the
invention of the complete patch-system goes beyond the target of Ant.

Nico



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

Posted by Peter Donald <pe...@apache.org>.
On Thu, 27 Dec 2001 18:56, Jeff Turner wrote:
> I'd like to invent one though :) I was thinking along the lines of a
> .jar file containing updates, with an Ant script, META-INF/control.xml,
> which describes how the contents of the jar must be applied.

Sounds good to me. Basically a cross-platform Installshield style app ? 
except with a kooler "script" language and a poorer dialog library? WOuld 
love to have one made - not willing to do the work though ;)

I actually needed something like this in November.

-- 
Cheers,

Pete

--------------------------------------------------
you've made a dangerous leap right over common 
sense, like some kind of metaphysical Evil Knievel
--------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] Ant-driven update system (Re: Best way to add file to CVS repository?)

Posted by Ken Gentle <j....@acm.org>.
The article linked below describes a "self-extracting jar" that might be a 
core to build such a utility around.

http://www.javaworld.com/javaworld/javatips/jw-javatip120.html


I have to agree with some of the other posts about this not being a core 
Ant capability, although such a utility would be useful.

IIRC, IBM's alphaworks had a java based installation tool as well.  Might 
be worth a look.

         Ken

At 06:56 PM 12/27/2001 +1100, you wrote:
>(Cc'ing ant-dev for thread continuity.. please don't reply there:)
>
>
>Incidentally, 'diff -N' is not a general, nor cross-platform, solution
>to the problem of how to convey updates.
>
>I'd like to invent one though :) I was thinking along the lines of a
>.jar file containing updates, with an Ant script, META-INF/control.xml,
>which describes how the contents of the jar must be applied.
>
>Basically, a jar file that knows what to do with itself. Much like an
>RPM or .deb file.
>
>These jars are 'applied' to a system by running another Ant script,
>which:
>
>  - optionally fetches the jar via a HTTP GET.
>  - verifies the jar signature
>  - unpacks the jar, and transfers control to META-INF/control.xml,
>    which:
>    - Ensures that the files to be replaced/patched validate against a
>      MD5 checksum (to be sure we're not overwriting modifications)
>    - If they do, replace/patch/remove them.
>    - Optionally do things like restart Tomcat, if the updates are for a
>      website.
>  - Control then passes back to the invoking script, which cleans up.
>
>
>My primary use-case is that of distributing updates to a client-managed
>website. Each 'update' consists of new/modified jars, a few JSPs, and
>perhaps a web.xml modification. These can't be done via CVS because
>they're behind a firewall, and can't be done with 'diff', because
>they're on WinNT. Hence the need for a cross-platform mechanism for
>applying self-contained updates.
>
>
>Anyone know of something like this, or a better solution? If anyone's
>interested, I have a prototype (without the jar signature verification
>or MD5 checksumming), and would be happy to collaborate further in the
>development of such a system.
>
>
>--Jeff
>
>
>On Thu, Dec 27, 2001 at 05:38:48PM +1100, Jeff Turner wrote:
> > On Wed, Dec 26, 2001 at 08:36:15PM -0600, Steve Cohen wrote:
> > > What is the best way for someone not a committer to submit a totally new
> > > file for the ant CVS repository?  Last time I did this, I just sent it
> > > an an attachment with the bug report I'd submitted.
> > >
> > > However, this seems like a kludgey way to go about it.  Ideally, it
> > > seems to me, a new file should fit into the CVS patch file the way
> > > anything else does.  But of course, since you haven't checked it out,
> > > CVS knows nothing about it and cvs diff won't work.  Is there a way to
> > > get this into the patches file?  Or is sending it as a separate
> > > attachment the only way?
> >
> > One way is to:
> >
> > a) get the cvsutils scripts from http://www.red-bean.com/cvsutils/.
> >    Worth getting anyway. I don't know what I'd do without 'cvsco' :)
> >
> > b) Do a 'cvsdo add <file>', which modifies CVS/Entries to mark the file
> > as new (without contacting the server).
> >
> > c) Generate the diff with 'cvs -RuN' (Recursion, unified, New files).
> > 'man diff' says:
> >
> >   -N
> >   --new-file
> >      In directory comparison, if a file is found in only one directory,
> >      treat it as present but empty in the other directory.
> >
> >
> > I can add this to the task guidelines if it's not deemed to hackish :)
> >
> >
> > --Jeff
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

==========================================================================
J. Kenneth Gentle (Ken)       | Phone: (610) 255-0361   FAX:(610) 255-0418
Gentle Software, LLC          | Email: j.kenneth.gentle@acm.org
==========================================================================


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>