On Sat, 17 Oct 2015 10:49:13 -0700
Matt Turner <[email protected]> wrote:

> On Sat, Oct 17, 2015 at 10:37 AM, Michał Górny <[email protected]> wrote:
> > On Fri, 16 Oct 2015 03:22:48 +1100
> > Michael Palimaka <[email protected]> wrote:
> >  
> >> On 16/10/15 03:04, Michał Górny wrote:  
> >> >
> >> >
> >> > Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka 
> >> > <[email protected]> napisał(a):  
> >> >> This could happen if ninja is manually enabled (eg. make.conf) but not
> >> >> installed
> >> >> ---
> >> >> eclass/cmake-utils.eclass | 5 +++++
> >> >> 1 file changed, 5 insertions(+)
> >> >>
> >> >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
> >> >> index 480cd09..012b13f 100644
> >> >> --- a/eclass/cmake-utils.eclass
> >> >> +++ b/eclass/cmake-utils.eclass
> >> >> @@ -228,6 +228,11 @@ _generator_to_use() {
> >> >>
> >> >>    case ${CMAKE_MAKEFILE_GENERATOR} in
> >> >>            ninja)
> >> >> +                  # if ninja is enabled but not installed, the build 
> >> >> could fail
> >> >> +                  # this could happen if ninja is manually enabled 
> >> >> (eg. make.conf)
> >> >> but not installed
> >> >> +                  if ! has_version dev-util/ninja; then  
> >> >
> >> > I'd suggest avoiding has_version and just checking for the binary. type 
> >> > -P, I think. Ciaran can give you the rationale, I believe.  
> >>
> >> There's no guarantee that the binary will be provided by dev-util/ninja
> >> (we've had a bug about this already).  
> >
> > Excuse me but did you agree with me, then commit the old version anyway?  
> 
> I didn't seem like he agreed with you. He explained that checking for
> a binary named ninja isn't sufficient because some versions of
> net-irc/ninja install a 'ninja' binary. See bug
> https://bugs.gentoo.org/show_bug.cgi?id=436804

Well, he didn't make it clear it's about *another* binary. In any case,
two wrongs don't make a right. has_version() should really be avoided.
In any case, I'd even prefer doing negative has_version() for known-bad
net-irc/ninja (assuming we really need to care about it still) as
has_version check failing in this case would be much less irritating
that has_version check required to proceed.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

Attachment: pgpLYAzzO8mV3.pgp
Description: OpenPGP digital signature

Reply via email to