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 F12616DE024A for ; Tue, 3 Jan 2017 07:52:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.517 X-Spam-Level: X-Spam-Status: No, score=0.517 tagged_above=-999 required=5 tests=[AWL=-0.135, 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 Rlxfl2epZ7fT for ; Tue, 3 Jan 2017 07:52:18 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 9C4986DE00AC for ; Tue, 3 Jan 2017 07:52:18 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 5CD321001A3; Tue, 3 Jan 2017 17:52:15 +0200 (EET) From: Tomi Ollila To: mp39590@gmail.com, notmuch@notmuchmail.org Subject: Re: [PATCH] tests: add compatibility layer In-Reply-To: References: <87lguwfjhw.fsf@rocinante.cs.unb.ca> <20170102135721.93882-1-mp39590@gmail.com> 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: Tue, 03 Jan 2017 15:52:20 -0000 On Tue, Jan 03 2017, Tomi Ollila wrote: > > To fix the above, one could use (possibly better written) mkwrap() > implementation, or do all of those by hand: e.g. > > if command -v gdate >/dev/null; then date () { gdate "$@"; }; fi > if command -v gbase64 >/dev/null; then base64 () { gbase64 "$@"; }; fi > ... > > the gdb wrapper could be dumped completely and have the following in > test-lib-common.sh: > > : ${NOTMUCH_GDB:-gdb} Argh, the above would not work, but this: : ${NOTMUCH_GDB:=gdb} emphasis++ ftw \o/ ! ;) Tomi > > and then replace all (the few) gdb in code with $NOTMUCH_GDB (did not use > quotes like "$NOTMUCH_GDB" so that one can hack args there. > > but if the gdb function were there, then the following might work: > > gdb () { command ${NOTMUCH_GDB:-gdb} "$@"; } >