From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67037 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.comp.tex.context Subject: Changes for setuptex Date: Tue, 15 Mar 2011 10:50:27 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0904174801==" X-Trace: dough.gmane.org 1300182641 9407 80.91.229.12 (15 Mar 2011 09:50:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2011 09:50:41 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 15 10:50:37 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PzQtf-0005vT-RT for gctc-ntg-context-518@m.gmane.org; Tue, 15 Mar 2011 10:50:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 245A1CAB10; Tue, 15 Mar 2011 10:50:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xH7IzSDaEYzm; Tue, 15 Mar 2011 10:50:32 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6D9B3CAB0D; Tue, 15 Mar 2011 10:50:32 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D122FCAB0D for ; Tue, 15 Mar 2011 10:50:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i9IY2ch-hQp9 for ; Tue, 15 Mar 2011 10:50:28 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id D297ECAB09 for ; Tue, 15 Mar 2011 10:50:28 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2F9oRh4018637 for ; Tue, 15 Mar 2011 10:50:28 +0100 Original-Received: by fxm18 with SMTP id 18so463781fxm.14 for ; Tue, 15 Mar 2011 02:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=MB1CtNgsEvS3stMVOso3YXB3thkJdkCtJARICd93fsY=; b=cfIsUeASGk68uAzB9hqMWaa5KEaMH55vAjXpnCU1jH15T6Jqwiry77bH5wxjEBBd1F P2hgBwTHSPaC7uhpcCaX387OzO+91M5Z5S3S2cllRzuUJWr1cGbfTPKtw5jJUxSRqtbN O27MiLVn9pA/IwOVIS1fpJ3A/lfp8itSn/Ljk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OnPHuBFAjLa+wcKJEJecej7dXo+0nDNfb+mNa5BiN4en44nWGUDjh3mNg4gFCumYUI LfCkIrPtC/22JVEQe2f2+VU+RAL6d8CsKDmioJEs0eAFwE7qZ403nYqf8Sfz/p/jnZkG KJe3nJPNwTVAj9AznmZILO6EzlbYzPmIMTyuA= Original-Received: by 10.223.95.197 with SMTP id e5mr10949839fan.31.1300182627620; Tue, 15 Mar 2011 02:50:27 -0700 (PDT) Original-Received: by 10.223.110.71 with HTTP; Tue, 15 Mar 2011 02:50:27 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0bEjlOrfm - f69995cf972a - 20110315 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:67037 Archived-At: --===============0904174801== Content-Type: multipart/alternative; boundary=00248c0ef15ea99884049e825bc7 --00248c0ef15ea99884049e825bc7 Content-Type: text/plain; charset=ISO-8859-1 To make the shell script setuptex more robust I would add at the beginning: set -o errexit set -o nounset function isVarSet() { if [[ ${#} -ne 1 ]] ; then fatal "${FUNCNAME} " return fi declare -p ${1} &>/dev/null return } And use: if ! isVarSet PS1 ; then instead of: if [ "x$PS1" != "x" ] ; then I use in my script that calls setuptex set -o errexit set -o nounset and that breaks the script. With my change there is no problem. -- Cecil Westerhof --00248c0ef15ea99884049e825bc7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable To make the shell script setuptex more robust I would add at the beginning:=
set -o errexit
set -o nounset

function isVarSet() {
=A0 if= [[ ${#} -ne 1 ]] ; then
=A0=A0=A0 fatal "${FUNCNAME} <VARIABLE-= NAME>"
=A0=A0=A0 return
=A0 fi

=A0 declare -p ${1} &>/dev/null=A0 return
}

And use:
=A0=A0=A0 if=A0 ! isVarSe= t PS1=A0 ; then
instead of:
=A0=A0=A0 if [ "x$PS1" !=3D &qu= ot;x" ] ; then

I use in my script that calls setuptex
set -o errexit
set -o nounset

and that breaks the script. With my change there is no problem.

= --
Cecil Westerhof
--00248c0ef15ea99884049e825bc7-- --===============0904174801== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0904174801==--