From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id AD3B96DE0ACD for ; Wed, 21 Dec 2016 06:56:35 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.13 X-Spam-Level: X-Spam-Status: No, score=0.13 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FVJGlD5arOnP for ; Wed, 21 Dec 2016 06:56:35 -0800 (PST) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arlo.cworth.org (Postfix) with ESMTPS id 968B36DE0AAB for ; Wed, 21 Dec 2016 06:56:34 -0800 (PST) Received: by mail-lf0-f65.google.com with SMTP id y21so13991241lfa.0 for ; Wed, 21 Dec 2016 06:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:message-id:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding; bh=DcptPOZlGNHTTSwPq6qP/abu/fQ8kL7mwK3yfCYjbRE=; b=BeCVx0QQ5P7eb+BIA6rItClkBVd8RZfivtVai7SLwu5+nAOhRGnOCx6NpIrE+OHNzP heMFZcC5S8sNLnNob4A8yzqrT5+uB+WqVqHrBtnoim3UeXNRYVbA8uDp64ipWw0hq2Iw rPCVra5j1jjiC/0xDBIlHMXYSm46aCN66VsCJ30468JzUY5Qdr/cGzyPfX64TkwGWt2I JRnlLlntoLSvFktBpFwVctTybVh0SE07K8233rhJt9dGZ/MCwhF3sJOqFAoBDf7FlZC/ fOhId0+zUc1HuaG8shmXs6P5hp6SVo0/tW2T0exkvUSxWs8MeU0KTa0+V3uldaMR/AUd o+zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:message-id:to:cc:subject:in-reply-to :references:mime-version:content-transfer-encoding; bh=DcptPOZlGNHTTSwPq6qP/abu/fQ8kL7mwK3yfCYjbRE=; b=HuveTYNUNBLlmF/OjMhfxr3gaGU0hXf92Q4uT2vaed5gvr/RET3jX5eiLi6Tpi8smt WXJa+qCAZbSkhXa4ipcVOlaTDyS4nFH0ol6meLNIDVVcQ7GBaX2AvbNgDOfZ6vPenzVg nVQFGE0hfXiIC9F5nAMWvxXofuZ9Re+Q7ZBr8u78Xi6HO2esAHUj2W5sIWDSybZEFi/v EQqsgDIJ8zO8BAhcuJiyuePtlnBYbG9lbbYOYlNJXT8BEtB0QVafEDsauWcQSPTLhGes Enp3nL76auOgpPJ8b7uzJwm1Zg7h/OkTYFLdieQpQnnryQzszNGvinLNgbjr8sdklzrp DSiQ== X-Gm-Message-State: AIkVDXJK2gooPF9FfeEci/Vtpzv1Hv+JGOyrZzfgI7sbUeDIpfR/pCi487xnzBxDVK183g== X-Received: by 10.25.67.12 with SMTP id q12mr1996884lfa.139.1482332192407; Wed, 21 Dec 2016 06:56:32 -0800 (PST) Received: from [192.168.100.4] (ppp109-252-15-79.pppoe.spdop.ru. [109.252.15.79]) by smtp.gmail.com with ESMTPSA id o196sm5871329lff.18.2016.12.21.06.56.31 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Dec 2016 06:56:31 -0800 (PST) Date: Wed, 21 Dec 2016 17:56:27 +0300 From: Mikhail X-Mailer: The Bat! (v7.4) Home Message-ID: <59549208.20161221175627@gmail.com> To: David Bremner CC: notmuch@notmuchmail.org Subject: Re: [PATCH] tests: add compatibility layer In-Reply-To: <87tw9y2q8i.fsf@rocinante.cs.unb.ca> References: <20161220194705.46874-1-mp39590@gmail.com> <87tw9y2q8i.fsf@rocinante.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 14:56:35 -0000 David wrote 21.12.2016, 1:24:45: > mp39590@gmail.com writes: >> >> +# OS independent functions >> +# >> +# Alias native BSD utilities to usable GNU equivalents. >> +case `uname` in >> +FreeBSD) >> + # allow using aliases in scripts >> + shopt -s expand_aliases >> + >> + alias date=gdate >> + alias base64=gbase64 >> + alias gdb=$BSD_GDB >> + alias wc=gwc >> + alias sed="gsed" >> + alias sha256sum=gsha256sum >> + ;; >> +esac >> + > What about adding (most of) this to sh.config by the configure script? > I'd like to centralize all hacky platform detection there. Do you mean something like this? - Checking $platform and conditionally adding shopt and aliases. But one must be sure that every script that source sh.config is a bash script. diff --git a/configure b/configure index 72db26df..ef6f657f 100755 --- a/configure +++ b/configure @@ -1205,6 +1205,23 @@ NOTMUCH_PYTHON=${python} NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev} EOF +# Alias native BSD utilities to usable GNU equivalents. +if [ $platform == FREEBSD ]; then + cat >> sh.config < Also, why is gsed in quotes but none of the others are? Fixed, thanks.