From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4010:c07::230; helo=mail-lf0-x230.google.com; envelope-from=arvindprasanna@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B9E752202E4BE for ; Thu, 15 Mar 2018 23:12:08 -0700 (PDT) Received: by mail-lf0-x230.google.com with SMTP id t132-v6so13688430lfe.2 for ; Thu, 15 Mar 2018 23:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Yxg3fzjPIHvauoimjOE7CSSfELSoZj7DnSnQFtw+t78=; b=gURzG4sONC/wCtfd0Vnz+uT+8C/dqe60FfSeekfx7eP0R+f7KT341N2leW15SeBIjb FACFRLbAGhkDHdPchMPuoKdSMiy5qrqG63Mqjb2Jw/ZMvfR4r38D+ArXgy+dfuBFNG2X Ucj/w7Leab2tJUWnQS9bEp81GkzIdyETsJSF+RxgZDeGjcDMoUZeHsMGAnmqnE6DN7ZL KbqElS5Z4omgaVUY3hozgyWvHlRUMDubn8ruoCDveVxjmSCb8RbhUhX/nEUECQ13OtkB 8PySBCRPf2fy0YC+M0xSCNsrvGy0CfSuYDOJB8VvuTjjahM5nu5zWxc6p2jiv9ryaPiI f6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Yxg3fzjPIHvauoimjOE7CSSfELSoZj7DnSnQFtw+t78=; b=kxSvGl/YKA1MqPyf1/7DUoEIL/qezhQ9OTzh6wqesBYVK2ILFFHP+Zio1ECIbVLzo2 +DjruwqkEkgSwJ1jr4Cdaaj84m+Hdki5On8i8yWf+I9i6JYxEQdOlIfIfscLcQbCyAHd 95gpjxEQJw7QEKiwq9QVFsoQYt+71fXxsPVRamQOAXOQDhMhjkoFFiXZrRZLojTELPOq cLXbxU6XPM5g5AeQAfTwsTvSQ4zf83wTPqutoES30Rs+m1JHSehtztXdFNkPN1MW7Wmo j2vTscbRJO2kv23uMZgP48hOVZCtpfs9LUM0WAxuWMbnHL28dE7VExcQYndG6rZGuJ3v DySQ== X-Gm-Message-State: AElRT7HZvTSLIPP5LS7aPNKBN1ZdPMLfd6o1eEU5GO8Kwi3J7s0rVjoC AjTpcaQOoGtcWTrmqiX0d5yetdo43P19E3EVwZc= X-Google-Smtp-Source: AG47ELsuaEiAN38CwpUT+yz4Hb8QulPwewNhWYxd4mY+PUtphpiZAV+opkixVnYnGNgROASV1etXscjBiurKeFk0tgE= X-Received: by 10.46.127.4 with SMTP id a4mr435143ljd.71.1521181111077; Thu, 15 Mar 2018 23:18:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.179.94.144 with HTTP; Thu, 15 Mar 2018 23:18:29 -0700 (PDT) In-Reply-To: <20180314112520.jzhk3aajfz3tyq6m@bivouac.eciton.net> References: <1520698318-9232-1-git-send-email-arvindprasanna@gmail.com> <20180314112520.jzhk3aajfz3tyq6m@bivouac.eciton.net> From: Arvind Prasanna Date: Fri, 16 Mar 2018 02:18:29 -0400 Message-ID: To: Leif Lindholm Cc: edk2-devel@lists.01.org X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: [PATCH] edksetup.sh: Update help section regarding positional X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 06:12:09 -0000 Content-Type: text/plain; charset="UTF-8" Hi Leif: Thank you for your feedback. I concur with you that it is a bash side effect, desired or undesired :) . I ran into this issue with positional parameters and thought a small message would be helpful to users. I will no longer pursue this issue. Thanks, Arvind. On Wed, Mar 14, 2018 at 7:25 AM, Leif Lindholm wrote: > Hi Arvind, > > On Sat, Mar 10, 2018 at 11:11:58AM -0500, Arvind Prasanna wrote: > > It is possible to source edksetup.sh from another script. If the > > calling/sourcing script has any positional parameters set, those are > > incorrectly accounted for in edksetup.sh while sourcing it resulting in > > the the help section always being shown. This patch updates the help > > section advising the user about these set positional parameters so they > > can be unset prior to sourcing edksetup.sh. > > This is really just one of the unpleasantries of sourcing shell > scripts. > > Since the current script could only ever work with bash anyway (and > not sh, dash, ...) I don't know that we could do much better - and > there's nothing about the problem that is specific to this script. > > As an aside, since we _know_ this only works on bash, you can also > make use of the bash side effect that if you pass any arguments to the > sourced script, it gets its own copies of $#, $0, $1 and so on. > > For ancient backwards compatility, the parameter BaseTools is ignored > if provided on the command line. So you could always just use > edksetup.sh BaseTools > > Alternatively, you can use > edksetup.sh --reconfig > which also ensures you are always using the latest toolchain > templates. > > Regards, > > Leif > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Arvind Prasanna > > --- > > edksetup.sh | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/edksetup.sh b/edksetup.sh > > index 93d6525..a3d5560 100755 > > --- a/edksetup.sh > > +++ b/edksetup.sh > > @@ -42,6 +42,8 @@ function HelpMsg() > > echo Please note: This script must be \'sourced\' so the environment > can be changed. > > echo ". $SCRIPTNAME" > > echo "source $SCRIPTNAME" > > + echo "If this script is being sourced from another script, please > ensure that the" > > + echo "sourcing/calling script has no set postional parameters." > > } > > > > function SetWorkspace() > > -- > > 2.7.4 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel >