From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 94D40138262 for ; Sat, 21 May 2016 22:12:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE9AB141F9; Sat, 21 May 2016 22:11:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E158C21C012 for ; Sat, 21 May 2016 22:11:50 +0000 (UTC) Received: from localhost (cpc92302-cmbg19-2-0-cust189.5-4.cable.virginm.net [82.1.208.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: aidecoe) by smtp.gentoo.org (Postfix) with ESMTPSA id 06FBA340C9D; Sat, 21 May 2016 22:11:48 +0000 (UTC) From: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= To: =?utf-8?B?TWljaGHFgiBHw7Nybnk=?= Cc: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] rebar.eclass: Build Erlang/OTP projects using dev-util/rebar In-Reply-To: <20160521224814.55493d6c.mgorny@gentoo.org> References: <1463610918-4062-1-git-send-email-aidecoe@gentoo.org> <1463837160-622-1-git-send-email-aidecoe@gentoo.org> <20160521224814.55493d6c.mgorny@gentoo.org> User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sat, 21 May 2016 23:11:45 +0100 Message-ID: <877fenvz6m.fsf@freja.aidecoe.name> 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; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Archives-Salt: d0404943-f480-4a08-8745-206ab7468f4a X-Archives-Hash: 5f54b2cf143918f168e320e4a26d89ab --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Micha=C5=82 G=C3=B3rny writes: >> +# Run rebar with verbose flag. Die on failure. >> +erebar() { >> + debug-print-function ${FUNCNAME} "${@}" >> + >> + (( $# > 0 )) || die 'erebar: at least one target is required' > > Why not [[ $# -gt 0 ]]? It's the first time I see someone using (( )) > for conditionals. '>' reads better than some '-gt'. >> + evar_push ERL_LIBS >> + export ERL_LIBS=3D"${EPREFIX}$(get_erl_libs)" > > local -x ERL_LIBS=3D... > > We don't really have to employ terribly ugly eval hackery to have > a local variable. Fixed. I hoped there's better way! (-: > I meant indent like this: > > + eawk rebar.config \ > + -v erl_libs=3D"${erl_libs}" -v pn=3D"${pn}" -v pv=3D"${pv}" \ > + '/^{[[:space:]]*erl_opts[[:space:]]*,/, /}[[:space:]]*\.$/ { > + pattern =3D "\"(./)?deps/" pn "/include\""; > + if (match($0, "{i,[[:space:]]*" pattern "[[:space:]]*}")) { > + sub(pattern, "\"" erl_libs "/" pn "-" pv "/include\""); > + } > + print $0; > + next; > + } > + 1 > + ' || die "failed to fix include paths in rebar.config" OK. >> + insinto "${dest}" >> + doins -r ebin >> + [[ -d include ]] && doins -r include >> + [[ -d bin ]] && for bin in bin/*; do dobin "$bin"; done >> + [[ -d priv ]] && cp -pR priv "${ED}${dest}/" > > Missing ||die. Just don't do it as one-liner :-P. You've got me! ;-) Thanks, =2D-=20 Amadeusz =C5=BBo=C5=82nowski --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1 iQJ8BAEBCgBmBQJXQN0hXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCMzcyRTFENjI5NUM1MzYwQTQwODQyRUZD QkNDODAyM0Y1OUUxNzA0AAoJEMvMgCP1nhcEaL4P/j5EcxOLqR3YPPMsMoABd3KS r9QvfZZKSRfS4EUUlZb4Gup6QAhin+OL3FDv2UJJ/5EDmSs6gXNsUxUn7ycz1/ft nA1f048+3oAy/oqZ6bVMUfd3LxZXkG6I7gmcnNcOIbBnzSy2Nzsy/a8JwhlBQ29j Wuj7Gmg6xsIPnsVg0eW/bIppXENYeMxV7CmuAQSbOQxpR9nvr740jBzQ2ERpRo4J w56b3DeOCLDPUesVD6utIy0Nq7laKfhpwCvYGCOaeiORsILlXRSX0uAGhzHIQDIQ eOKGiKZ2K2ECgfj2xCkkLdoqs6O5KAbDzeRhxVUnLfRBTl+ykX6X0krSJ1kf5ZGa 5zb6LnbKjY0GcqXLrYw6udytJNER9MVPpTn0uyKABdKfG2voqjW02Ztu2xApkKc9 Xj2nPz+fNloBerFXhOkq7iI+kpKH6/sjO1cdJV6tziSPcsjpCMq9TxYNiE4R2yJn /GR4F+QNCQPcqH9UrhqQlBwISDY8eAXScI8sp59ooaj1/GpsS1mYsFhFbYEc3vmW Rh2HFySW+8ix7avHo08WlxaabjC9nLAmycXANGW/5JlHO5+0qaPybHoUNyq5D34Q 2E4ljUxKi8iIM2aU8MJrhodgW6pOD8wIpqqPzNYlSpAe3SqJ67lR06itc8/1Sk1m dPoLV7kF3s5wv0NDeU7D =JBki -----END PGP SIGNATURE----- --=-=-=--