public inbox for gentoo-pms@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-pms] best_version: missing failure behavior
@ 2012-09-09 21:31 Michał Górny
  2012-09-10  6:40 ` Ciaran McCreesh
  0 siblings, 1 reply; 8+ messages in thread
From: Michał Górny @ 2012-09-09 21:31 UTC (permalink / raw
  To: gentoo-pms

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

> best_version Takes exactly one package dependency specification
> as an argument. If a matching package is installed, prints
> the category, package name and version of the highest matching
> version.

What happens if no matching package is installed? Is it then even legal
to call the function then?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] best_version: missing failure behavior
  2012-09-09 21:31 [gentoo-pms] best_version: missing failure behavior Michał Górny
@ 2012-09-10  6:40 ` Ciaran McCreesh
  2012-09-10  7:30   ` Michał Górny
  0 siblings, 1 reply; 8+ messages in thread
From: Ciaran McCreesh @ 2012-09-10  6:40 UTC (permalink / raw
  To: gentoo-pms

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

On Sun, 9 Sep 2012 23:31:24 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> > best_version Takes exactly one package dependency specification
> > as an argument. If a matching package is installed, prints
> > the category, package name and version of the highest matching
> > version.
> 
> What happens if no matching package is installed? Is it then even
> legal to call the function then?

If there's no matching package installed, it doesn't print anything.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] best_version: missing failure behavior
  2012-09-10  6:40 ` Ciaran McCreesh
@ 2012-09-10  7:30   ` Michał Górny
  2012-09-10  7:35     ` Ciaran McCreesh
  0 siblings, 1 reply; 8+ messages in thread
From: Michał Górny @ 2012-09-10  7:30 UTC (permalink / raw
  To: gentoo-pms; +Cc: ciaran.mccreesh

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

On Mon, 10 Sep 2012 07:40:40 +0100
Ciaran McCreesh <ciaran.mccreesh@googlemail.com> wrote:

> On Sun, 9 Sep 2012 23:31:24 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
> > > best_version Takes exactly one package dependency specification
> > > as an argument. If a matching package is installed, prints
> > > the category, package name and version of the highest matching
> > > version.
> > 
> > What happens if no matching package is installed? Is it then even
> > legal to call the function then?
> 
> If there's no matching package installed, it doesn't print anything.

Is it guaranteed to return with 0 exit status then?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] best_version: missing failure behavior
  2012-09-10  7:30   ` Michał Górny
@ 2012-09-10  7:35     ` Ciaran McCreesh
  2012-09-10 13:01       ` [gentoo-pms] [PATCH] best_version: make failure behavior clear Michał Górny
  0 siblings, 1 reply; 8+ messages in thread
From: Ciaran McCreesh @ 2012-09-10  7:35 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-pms

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

On Mon, 10 Sep 2012 09:30:35 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> On Mon, 10 Sep 2012 07:40:40 +0100
> Ciaran McCreesh <ciaran.mccreesh@googlemail.com> wrote:
> > On Sun, 9 Sep 2012 23:31:24 +0200
> > Michał Górny <mgorny@gentoo.org> wrote:
> > > > best_version Takes exactly one package dependency specification
> > > > as an argument. If a matching package is installed, prints
> > > > the category, package name and version of the highest matching
> > > > version.
> > > 
> > > What happens if no matching package is installed? Is it then even
> > > legal to call the function then?
> > 
> > If there's no matching package installed, it doesn't print anything.
> 
> Is it guaranteed to return with 0 exit status then?

Paludis returns non-zero if there's nothing installed, and zero if a
match is found. Don't know if Portage does the same, or whether we want
to guarantee this behaviour.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-pms] [PATCH] best_version: make failure behavior clear.
  2012-09-10  7:35     ` Ciaran McCreesh
@ 2012-09-10 13:01       ` Michał Górny
  2012-09-10 14:49         ` Ulrich Mueller
  2012-09-13  6:33         ` Ulrich Mueller
  0 siblings, 2 replies; 8+ messages in thread
From: Michał Górny @ 2012-09-10 13:01 UTC (permalink / raw
  To: gentoo-pms; +Cc: Michał Górny

---
 pkg-mgr-commands.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 6847a1a..39c2680 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -81,7 +81,7 @@ these commands once the current phase function has returned.
     true if a package matching the atom is installed in \t{ROOT}, and false otherwise.
 \item[best\_version] Takes exactly one package dependency specification as an argument. If a
     matching package is installed, prints the category, package name and version of the highest
-    matching version.
+    matching version; otherwise, prints an empty string. The exit code is implementation-defined.
 \end{description}
 
 \subsubsection{Output commands}
-- 
1.7.12



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] [PATCH] best_version: make failure behavior clear.
  2012-09-10 13:01       ` [gentoo-pms] [PATCH] best_version: make failure behavior clear Michał Górny
@ 2012-09-10 14:49         ` Ulrich Mueller
  2012-09-10 16:38           ` Michał Górny
  2012-09-13  6:33         ` Ulrich Mueller
  1 sibling, 1 reply; 8+ messages in thread
From: Ulrich Mueller @ 2012-09-10 14:49 UTC (permalink / raw
  To: gentoo-pms; +Cc: Michał Górny

>>>>> On Mon, 10 Sep 2012, Michał Górny wrote:

> --- a/pkg-mgr-commands.tex
> +++ b/pkg-mgr-commands.tex
> @@ -81,7 +81,7 @@ these commands once the current phase function has returned.
>      true if a package matching the atom is installed in \t{ROOT}, and false otherwise.
>  \item[best\_version] Takes exactly one package dependency specification as an argument. If a
>      matching package is installed, prints the category, package name and version of the highest
> -    matching version.
> +    matching version; otherwise, prints an empty string. The exit code is implementation-defined.
>  \end{description}
 
>  \subsubsection{Output commands}

Do we really need to mention the exit status here? We also don't
mention it for commands like use_with.

Ulrich


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] [PATCH] best_version: make failure behavior clear.
  2012-09-10 14:49         ` Ulrich Mueller
@ 2012-09-10 16:38           ` Michał Górny
  0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2012-09-10 16:38 UTC (permalink / raw
  To: gentoo-pms; +Cc: ulm

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Mon, 10 Sep 2012 16:49:56 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:

> >>>>> On Mon, 10 Sep 2012, Michał Górny wrote:
> 
> > --- a/pkg-mgr-commands.tex
> > +++ b/pkg-mgr-commands.tex
> > @@ -81,7 +81,7 @@ these commands once the current phase function
> > has returned. true if a package matching the atom is installed in
> > \t{ROOT}, and false otherwise. \item[best\_version] Takes exactly
> > one package dependency specification as an argument. If a matching
> > package is installed, prints the category, package name and version
> > of the highest
> > -    matching version.
> > +    matching version; otherwise, prints an empty string. The exit
> > code is implementation-defined. \end{description}
>  
> >  \subsubsection{Output commands}
> 
> Do we really need to mention the exit status here? We also don't
> mention it for commands like use_with.

But here one could assume that failure could result in failure exit
status...

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-pms] [PATCH] best_version: make failure behavior clear.
  2012-09-10 13:01       ` [gentoo-pms] [PATCH] best_version: make failure behavior clear Michał Górny
  2012-09-10 14:49         ` Ulrich Mueller
@ 2012-09-13  6:33         ` Ulrich Mueller
  1 sibling, 0 replies; 8+ messages in thread
From: Ulrich Mueller @ 2012-09-13  6:33 UTC (permalink / raw
  To: gentoo-pms; +Cc: Michał Górny

Applied.

As discussed on IRC, I've changed "implementation-defined" to
"unspecified", to make it very clear that ebuilds cannot rely on the
exit code.

Ulrich


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-13  6:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-09 21:31 [gentoo-pms] best_version: missing failure behavior Michał Górny
2012-09-10  6:40 ` Ciaran McCreesh
2012-09-10  7:30   ` Michał Górny
2012-09-10  7:35     ` Ciaran McCreesh
2012-09-10 13:01       ` [gentoo-pms] [PATCH] best_version: make failure behavior clear Michał Górny
2012-09-10 14:49         ` Ulrich Mueller
2012-09-10 16:38           ` Michał Górny
2012-09-13  6:33         ` Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox