From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R3EUx-000648-BM for garchives@archives.gentoo.org; Mon, 12 Sep 2011 21:57:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA4DF21C168; Mon, 12 Sep 2011 21:56:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6065B21C036 for ; Mon, 12 Sep 2011 21:56:30 +0000 (UTC) Received: from pomiocik.lan (77-255-22-60.adsl.inetia.pl [77.255.22.60]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 6C1541B400C; Mon, 12 Sep 2011 21:56:28 +0000 (UTC) Date: Mon, 12 Sep 2011 23:58:27 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: gentoo-dev@lists.gentoo.org Cc: dberkholz@gentoo.org Subject: Re: [gentoo-dev] [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs. Message-ID: <20110912235827.43dfb959@pomiocik.lan> In-Reply-To: <20110912210020.GA31178@comet> References: <1315857465-8179-1-git-send-email-mgorny@gentoo.org> <20110912210020.GA31178@comet> Organization: Gentoo X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/gccj.fYl=4VbmEca7yLmOfh"; protocol="application/pgp-signature" X-Archives-Salt: X-Archives-Hash: 995e826bf0e21738eeb9b59acc0cb817 --Sig_/gccj.fYl=4VbmEca7yLmOfh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 12 Sep 2011 16:00:20 -0500 Donnie Berkholz wrote: > > # @FUNCTION: remove_libtool_files > > -# @USAGE: [all|none] > > +# @USAGE: [all|only-not-required|none] >=20 > Is there a way to document the arguments of eclass functions? You > added the name of the arg but didn't describe its purpose or why > anyone would want to use it. >=20 > On a semantic note, that argument name (only-not-required) doesn't > make sense to me. I might do something more helpful like > pkgconfig-duplicates instead. I thinked about 'as-needed' or sth like that. Maybe the new argument should be (temporarily) not public instead? > > + if [[ "$1" =3D=3D 'only-not-required' ]]; then >=20 > This is way more quoting than you need within double brackets. It's nice visual quoting, just to match the others. > > local f > > for f in $(find "${D}" -type f -name '*.la'); do > > # Keep only .la files with shouldnotlink=3Dyes - > > likely plugins local shouldnotlink=3D$(sed -ne > > '/^shouldnotlink=3Dyes$/p' "${f}") if [[ "$1" =3D=3D 'all' || -z > > ${shouldnotlink} ]]; then > > + if [[ "$1" =3D=3D 'only-not-required' ]]; then >=20 > Is there a case where one of those arguments might be $2 but you'd > still want to run this? Er? What are you referring to? > I feel like that shouldnotlink thing is really confusing the logic,=20 > because there's multiple nested tests for different values of $1 in > here instead of just testing the args once at the top and setting > variables. As mentioned earlier, the code needs to be refactored. First things first, then we'll rewrite it to be nice and clean. I don't really want to waste time doing this if we would need to rewrite it for more logic in the future. > > + # remove .la files only when .pc > > files provide the libs > > + # already or they don't give any > > information > > + ! has $(basename "${f}") > > ${pc_libs} \ > > + && [[ -n "$(sed -n > > \ >=20 > The comment says "or" but I see an "and" here. Because everything's negated here. Boolean magic :D. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/gccj.fYl=4VbmEca7yLmOfh Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iJwEAQEIAAYFAk5ugIMACgkQfXuS5UK5QB3u7AP/eaEUXDBW+o/mT0NrX8WZdXCl aqF6MtSepsoW0PVU+86zp0GCaDcw2HGMoe8L4ZLHIOrrGqpQcBsm4QUlGeTstCog qqkNlgbNn/rPE61I/F1eUEPepEdZPVKC1AoMUd8E7rmaObBjP1KMuiJHcbHy8jP7 Wn60actNMWeZo89dqSw= =J6uA -----END PGP SIGNATURE----- --Sig_/gccj.fYl=4VbmEca7yLmOfh--