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 62CD1138010 for ; Sun, 26 Aug 2012 22:33:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BABD9E0652; Sun, 26 Aug 2012 22:33:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 849C0E019D for ; Sun, 26 Aug 2012 22:32:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id BC59133D77F for ; Sun, 26 Aug 2012 22:32:47 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Flag: NO X-Spam-Score: -1.58 X-Spam-Level: X-Spam-Status: No, score=-1.58 tagged_above=-999 required=5.5 tests=[AWL=-1.371, RP_MATCHES_RCVD=-0.207, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=no Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id maL24eKBgP7o for ; Sun, 26 Aug 2012 22:32:41 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B23133D73F for ; Sun, 26 Aug 2012 22:32:40 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T5lNn-0004zi-4r for gentoo-dev@gentoo.org; Mon, 27 Aug 2012 00:32:39 +0200 Received: from ip68-231-22-224.ph.ph.cox.net ([68.231.22.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Aug 2012 00:32:39 +0200 Received: from 1i5t5.duncan by ip68-231-22-224.ph.ph.cox.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Aug 2012 00:32:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-dev@lists.gentoo.org From: Duncan <1i5t5.duncan@cox.net> Subject: [gentoo-dev] Re: [RFC] new vala.eclass Date: Sun, 26 Aug 2012 22:32:30 +0000 (UTC) Message-ID: References: <1345910966.9829.9.camel@rook> <1345928676.9829.13.camel@rook> 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: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip68-231-22-224.ph.ph.cox.net User-Agent: Pan/0.139 (Sexual Chocolate; GIT 1f91845 /usr/src/portage/src/egit-src/pan2) X-Archives-Salt: 72762ca8-8b53-41e4-96a7-395f85ee1934 X-Archives-Hash: 46d9ad81ca5721f17ddc1d1acbe6fc04 Alexandre Rostovtsev posted on Sat, 25 Aug 2012 17:04:36 -0400 as excerpted: > [[ -n "${VALA_API_VERSION}" ]] || die "VALA_API_VERSION not set" It's just style, but... 1) [[ ]] manages non-word characters (whitespace, etc) hidden behind variables, so quotes are only necessary if they appear in string- literals, not the case here. I know eliminating the quotes is gentoo policy as I've seen it suggested many times before. 2) Gentoo policy regarding implied -n? I know gentoo policy prefers {} cuddled varnames to make the varname explicit, but does it prefer explicit -n as well, since that's implicit test behavior and thus does not need to be explicitly specified? To my way of thinking [[ ${var} ]] is even clearer than [[ -n ${var} ]] since there's only one way to interpret the former and I have to correctly parse the -n (as opposed to -any-other-letter) given the latter. They're even listed together in bash's "help test" output, so are considered to have identical behavior to the point of being listed together by bash itself. Incorporating both suggestions: [[ ${VALA_API_VERSION} ]] || die "VALA_API_VERSION not set" But regardless of #2, definitely eliminate the quotes inside the [[ ]], as I've seen that suggested numerous times in other cases. The better quote handling regarding variables is in fact one of the reasons the [[ ]] form is preferred to the POSIX compliant [ ] form. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman