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 C718E6DE0BF6 for ; Tue, 20 Dec 2016 21:11:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.518 X-Spam-Level: X-Spam-Status: No, score=0.518 tagged_above=-999 required=5 tests=[AWL=-0.134, SPF_NEUTRAL=0.652] 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 GLfo-yB9IyRg for ; Tue, 20 Dec 2016 21:11:42 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id EB4B96DE0BCA for ; Tue, 20 Dec 2016 21:11:41 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id A497110004A; Wed, 21 Dec 2016 07:12:12 +0200 (EET) From: Tomi Ollila To: David Bremner , mp39590@gmail.com, 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> User-Agent: Notmuch/0.23.3+85~g2b85e66 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain 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 05:11:43 -0000 On Wed, Dec 21 2016, David Bremner wrote: > 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. configure already checks kernel name $(uname) and -s is default so that info could be written to sh.config. (uname=$uname or something) the alias thing cannot be done in sh.config as that is bash spesific... ... but, alias is not needed; sed () { gsed "$@"; } eg... ... but still, I'd not start messing sh.config with anything else than variable settings... until there is need for such thing outside test scripts... so far gwc would not be needed is $((`... | wc -l`))'s are used there. have to check where gsha256sum is currently used... .. Tomi > > Also, why is gsed in quotes but none of the others are? > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch