Dnia 2015-10-10, o godz. 13:51:34
Michał Górny <mgo...@gentoo.org> napisał(a):

> Dnia 2015-10-10, o godz. 11:31:45
> "Manuel Rüger" <mr...@gentoo.org> napisał(a):
> 
> > commit:     9d15a1c12b3c4f98445a45c051733eb2a67fdb28
> > Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
> > AuthorDate: Sat Oct 10 11:30:54 2015 +0000
> > Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
> > CommitDate: Sat Oct 10 11:30:54 2015 +0000
> > URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d15a1c1
> > 
> > dev-libs/libgit2: Version bump
> > 
> > Package-Manager: portage-2.2.23
> 
> Pretty much picking up a random commit to point out a common mistake.

(removed mrueg@ from CC as he doesn't wish to be notified of QA issues
with his commits)

> > [...]
> > 
> > +src_configure() {
> > +   local mycmakeargs=(
> > +           -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
> > +           $(cmake-utils_use_build test CLAR)
> > +           $(cmake-utils_use_enable trace TRACE)
> 
> The second argument is redundant. cmake-utils has some internal magic
> to uppercase stuff, so trace->TRACE happens automagically.

Kensington from KDE team just asked me not to promote this automagic
feature. Therefore, only suggestion about usex holds.

> 
> Of course, some of us (like me) really hate unexpected magic like this.
> Then, it's more readable (and often shorter) to use:
> 
>   -DENABLE_TRACE=$(usex trace)
> 
> [just to be clear, yes/no returned by usex is as good as ON/OFF for
> cmake]
> 
> > +           $(cmake-utils_use_use gssapi GSSAPI)
> > +           $(cmake-utils_use_use ssh SSH)
> > +           $(cmake-utils_use threads THREADSAFE)
> > +   )
> 
> For comparison:
> 
>       local mycmakeargs=(
>               -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
>               -DBUILD_CLAR=$(usex test)
>               -DENABLE_TRACE=$(usex trace)
>               -DUSE_GSSAPI=$(usex gssapi)
>               -DUSE_SSH=$(usex ssh)
>               -DTHREADSAFE=$(usex threads)
>       )
> 
> Which one is shorter and less ambiguous?
> 
> > [...]
> 



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

Attachment: pgpYQwJ76IVEh.pgp
Description: OpenPGP digital signature

Reply via email to