You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Martin Weber <m....@razorcat.com> on 2009/08/19 13:44:15 UTC

How to specify latest.any status correctly?

Hi folks,

if I wish to express a dependency on a module of the latest revision,
with any status,
how do I express that verbatim in the ivy.xml file?

1) rev="latest.[any status]"
or
2) rev="latest.any status"
or
3) rev="latest." (seems to work, too)
or
4) rev="latest.any arbitrary text here" (seems to work, too)

The Ivy docs state that (1) is correct, but I'm not quite sure.

Regards,
	Martin


Re: How to specify latest.any status correctly?

Posted by Mitch Gitman <mg...@gmail.com>.
And I realize that one could make the argument that you don't need something
like "latest" or "latest.*" because, if you know your set of statuses, then
something like "latest.integration" gives you every status from integration
on up.

For my money, explicitly supporting something like "latest" or "latest.*"
would still be a nice shortcut. And there may be cases where you don't know
your full set of statuses so you don't know if "latest.integration" is your
"lowest" status.

On Mon, Aug 24, 2009 at 9:06 AM, Mitch Gitman <mg...@gmail.com> wrote:

> Echoing Martin here. Tom, thanks for clarifying this.
>
> I feel stupid now (and it's not the first time) for reading "[any status]"
> as a special flag rather than just a text placeholder in the documentation.
>
> But then do I understand correctly that there is no deliberate way with Ivy
> (short of exploiting this bug) to say, "Give me the latest revision
> regardless of status?" This goes back to what Martin wrote: "I consider that
> being a feature, not a bug."
>
> I believe that asking for the latest revision regardless of status is not
> such an uncommon or invalid thing to do and that there ought to be some more
> straightforward way to specify it short of exploiting the fact that Ivy
> doesn't check the requested revision against the known set of statuses.
>
> I think either "latest" or "latest.*" would be a reasonable syntax. Or
> better yet, both.
>
>
>

Re: How to specify latest.any status correctly?

Posted by Mitch Gitman <mg...@gmail.com>.
Echoing Martin here. Tom, thanks for clarifying this.

I feel stupid now (and it's not the first time) for reading "[any status]"
as a special flag rather than just a text placeholder in the documentation.

But then do I understand correctly that there is no deliberate way with Ivy
(short of exploiting this bug) to say, "Give me the latest revision
regardless of status?" This goes back to what Martin wrote: "I consider that
being a feature, not a bug."

I believe that asking for the latest revision regardless of status is not
such an uncommon or invalid thing to do and that there ought to be some more
straightforward way to specify it short of exploiting the fact that Ivy
doesn't check the requested revision against the known set of statuses.

I think either "latest" or "latest.*" would be a reasonable syntax. Or
better yet, both.

On Mon, Aug 24, 2009 at 7:44 AM, Martin Weber <m....@razorcat.com> wrote:

> Tom Widmer schrieb:
> > Martin Weber wrote:
> >> Mitch Gitman schrieb:
> >>> Martin, I can vouch that "latest.[any status]", as documented, does
> >>> work.
> >
> > The documentation does not say to literally write
> > 'rev="latest.[any status]"'!
>
> Hi Tom,
> thanks for clarifying this.
>
> [...]
> > That documentation may be incorrect though if you have custom statuses -
> > you should really use your least mature defined status name, whatever
> > that is (integration by default) (see
> >
> http://ant.apache.org/ivy/history/latest-milestone/settings/statuses.html)
> >
> > But it seems that the software interprets
> > latest.[random string that doesn't match any known status name]
> > as meaning the latest version, so you can get away with not reading the
> > docs!
>
> I consider that being a feature, not a bug. It allows to express 'give
> me the tatest revision, regardless of the status' without having to know
> what statuses have been configured for ivy. At least when you switch
> from ivy's predefined statuses to your home grown, it will save you a
> lot of typing.
>
> Martin
>
>

Re: How to specify latest.any status correctly?

Posted by Martin Weber <m....@razorcat.com>.
Tom Widmer schrieb:
> Martin Weber wrote:
>> Mitch Gitman schrieb:
>>> Martin, I can vouch that "latest.[any status]", as documented, does
>>> work.
> 
> The documentation does not say to literally write
> 'rev="latest.[any status]"'!

Hi Tom,
thanks for clarifying this.

[...]
> That documentation may be incorrect though if you have custom statuses -
> you should really use your least mature defined status name, whatever
> that is (integration by default) (see
> http://ant.apache.org/ivy/history/latest-milestone/settings/statuses.html)
> 
> But it seems that the software interprets
> latest.[random string that doesn't match any known status name]
> as meaning the latest version, so you can get away with not reading the
> docs!

I consider that being a feature, not a bug. It allows to express 'give
me the tatest revision, regardless of the status' without having to know
what statuses have been configured for ivy. At least when you switch
from ivy's predefined statuses to your home grown, it will save you a
lot of typing.

Martin


Re: How to specify latest.any status correctly?

Posted by Niklas Matthies <ml...@nmhq.net>.
On Mon 2009-08-24 at 14:02h, Tom Widmer wrote on ivy-user:
:
> But it seems that the software interprets latest.[random string that
> doesn't match any known status name] as meaning the latest version,
> so you can get away with not reading the docs!

Only until the implementation changes to reject strings that don't
match any known status name. Always code to the specification, not to
the implementation. ;)

IMO "lastest.*" would make a lot of sense for specifying "any status".

-- Niklas Matthies

Re: How to specify latest.any status correctly?

Posted by Tom Widmer <to...@googlemail.com>.
Martin Weber wrote:
> Mitch Gitman schrieb:
>> Martin, I can vouch that "latest.[any status]", as documented, does work.

The documentation does not say to literally write
'rev="latest.[any status]"'!

The docs say 
http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html

"latest.[any status] since 1.4
selects the latest revision of the dependency module with at least the 
specified status. "

That is saying that
latest.release
means latest with status release, and latest.x is latest with status x.

That page says that the latest revision can be got with
"latest.integration
selects the latest revision of the dependency module. "

That documentation may be incorrect though if you have custom statuses - 
you should really use your least mature defined status name, whatever 
that is (integration by default) (see 
http://ant.apache.org/ivy/history/latest-milestone/settings/statuses.html)

But it seems that the software interprets
latest.[random string that doesn't match any known status name]
as meaning the latest version, so you can get away with not reading the 
docs!

Tom


Re: How to specify latest.any status correctly?

Posted by Martin Weber <m....@razorcat.com>.
Mitch Gitman schrieb:
> Martin, I can vouch that "latest.[any status]", as documented, does work.

Hi Mitch,
thank you for clarifying that.
My Ivy files evolved over time and use any of the forms, which clearly
needs to be unified.


> 
> As for the 2), 3), 4) you cite, I imagine the reason Ivy allows any
> arbitrary text to work is because it allows arbitrary statuses and it
> doesn't know the full set of statuses at the time the dependency revision is

I guess, that the reason why
1) rev="latest.[any status]"
works, too.


>>>From my experience, what I can say does NOT work is "latest" simply by
> itself. For some reason, I had incorrectly recalled that was the way to
> express, "Give me the latest regardless of status," and soon enough found
> out otherwise. Actually, for my money, "latest" by itself would be an
> intuitive shorthand for "latest.[any status]".

I ran into that, too.

 Regards,
         Martin


Re: How to specify latest.any status correctly?

Posted by Mitch Gitman <mg...@gmail.com>.
Martin, I can vouch that "latest.[any status]", as documented, does work.

As for the 2), 3), 4) you cite, I imagine the reason Ivy allows any
arbitrary text to work is because it allows arbitrary statuses and it
doesn't know the full set of statuses at the time the dependency revision is
parsed. It seems like the 2) and 3) you offer are just variations of 4).

>From my experience, what I can say does NOT work is "latest" simply by
itself. For some reason, I had incorrectly recalled that was the way to
express, "Give me the latest regardless of status," and soon enough found
out otherwise. Actually, for my money, "latest" by itself would be an
intuitive shorthand for "latest.[any status]".

On Wed, Aug 19, 2009 at 4:44 AM, Martin Weber <m....@razorcat.com> wrote:

> Hi folks,
>
> if I wish to express a dependency on a module of the latest revision,
> with any status,
> how do I express that verbatim in the ivy.xml file?
>
> 1) rev="latest.[any status]"
> or
> 2) rev="latest.any status"
> or
> 3) rev="latest." (seems to work, too)
> or
> 4) rev="latest.any arbitrary text here" (seems to work, too)
>
> The Ivy docs state that (1) is correct, but I'm not quite sure.
>
> Regards,
>         Martin
>
>