From patchwork Wed Jan 29 16:50:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 23883 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0A9A720300 for ; Wed, 29 Jan 2014 16:51:19 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id w20sf4431234vbb.3 for ; Wed, 29 Jan 2014 08:51:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:from:to:cc:subject:precedence:reply-to:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type; bh=bsy/vGOdbfatSyvMhGgtSEkti3k5WHUsSyudXPdqR9c=; b=lyRLlAeuzFI0m9G/WXwMGqsPT3dBaXzReMip8o/5Avk/luHrRGzCmefzFbt6YgYpxD /Xnz4ktHDHK0ZBj4FdF6mVtu7BGHJo4jdU2aEWj6cFtp/4zS8DWHZWJhZGyqes8viZtD +rbu72U5gb9Nuj3hJaKrslAoq3ZnMCM8vLid31BUIMLw4DYKtp1zszr2lAClP/Bu8wHi H/iV7XvqO2s+H+KIA4JvAutIKDdZwFumoIHISNySqTRMaTahXr/Pcpb/b3XDT1faG9+j EEGPMnAZr4oZp+yy8on1cbHnCeoerij6eAj1D9od2VXqyWu2PAqS7xf+xxRjSuGb1Xez MTpQ== X-Gm-Message-State: ALoCoQmyfo++ufIcTTNBMVCGAPOsA923ExQnry0lg0tpzwE4yFi9kbkwhXVjL3UujLPAGqiFyedg X-Received: by 10.58.46.172 with SMTP id w12mr3077088vem.24.1391014278976; Wed, 29 Jan 2014 08:51:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.38 with SMTP id n35ls208131qga.68.gmail; Wed, 29 Jan 2014 08:51:18 -0800 (PST) X-Received: by 10.220.251.73 with SMTP id mr9mr7299212vcb.2.1391014278809; Wed, 29 Jan 2014 08:51:18 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id dq5si972872vcb.24.2014.01.29.08.51.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 08:51:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so1394475veb.13 for ; Wed, 29 Jan 2014 08:51:18 -0800 (PST) X-Received: by 10.52.185.1 with SMTP id ey1mr115500vdc.65.1391014278665; Wed, 29 Jan 2014 08:51:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp128143vcz; Wed, 29 Jan 2014 08:51:17 -0800 (PST) X-Received: by 10.50.72.36 with SMTP id a4mr30036479igv.40.1391014277012; Wed, 29 Jan 2014 08:51:17 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id hz8si5025876igb.35.2014.01.29.08.51.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 08:51:16 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1W8YLv-0004bQ-2D; Wed, 29 Jan 2014 16:51:03 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1W8YLs-0004bF-W3 for edk2-devel@lists.sourceforge.net; Wed, 29 Jan 2014 16:51:01 +0000 Received: from mail-qc0-f171.google.com ([209.85.216.171]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1W8YLp-0000JA-30 for edk2-devel@lists.sourceforge.net; Wed, 29 Jan 2014 16:51:00 +0000 Received: by mail-qc0-f171.google.com with SMTP id n7so3107983qcx.16 for ; Wed, 29 Jan 2014 08:50:51 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.224.69.133 with SMTP id z5mr13826464qai.57.1391014251140; Wed, 29 Jan 2014 08:50:51 -0800 (PST) Received: by 10.224.204.129 with HTTP; Wed, 29 Jan 2014 08:50:50 -0800 (PST) In-Reply-To: References: <4A89E2EF3DFEDB4C8BFDE51014F606A1117BEF40@SHSMSX102.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A1117BF07A@SHSMSX102.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A1117BFC23@SHSMSX102.ccr.corp.intel.com> Date: Wed, 29 Jan 2014 16:50:50 +0000 Message-ID: From: Leif Lindholm To: "edk2-devel@lists.sourceforge.net" , "Gao, Liming" X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1W8YLp-0000JA-30 Cc: "edk2-commits@lists.sourceforge.net" , "Parmeshwr_Prasad@Dell.com" Subject: Re: [edk2] edk2/edksetup.sh patch to solve command line parameter X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Actually, there is another issue with the new edksetup.sh - it returns success (0) regardless of whether the executions succeeds or not. The attached patch resolves both of these issues. Contributed-under: TianoCore Contribution Agreement 1.0 On 29 January 2014 16:31, Leif Lindholm wrote: > Hi Liming, > > This commit (15192) does not do what was described. > > It permits '. edksetup.sh BaseTool', rather than what was described in the > text - '. edksetup.sh BaseTools'. (missing a trailing 's') > > Regards, > > Leif > > > On 27 January 2014 07:46, Gao, Liming wrote: > >> Parmeshwr: >> >> Your patch is good. I will help commit it. >> >> Signed-off-by: Gao, Liming >> >> >> >> Thanks >> >> Liming >> >> *From:* Parmeshwr_Prasad@Dell.com [mailto:Parmeshwr_Prasad@Dell.com] >> *Sent:* Monday, January 27, 2014 3:00 PM >> *To:* Gao, Liming >> *Cc:* edk2-commits@lists.sourceforge.net >> *Subject:* RE: edk2/edksetup.sh patch to solve command line parameter >> >> >> >> Hi Liming, >> >> >> >> Please find new patch for edksetupp.sh. >> >> >> >> I have changes according to your comments. >> >> It can handle following cases. >> >> 1- Handle more than one parameter >> >> 2- Handle if first parameter is not "-?, -h, --help or BaseTool". >> >> 3- Any other thing to display error message. >> >> >> >> Please let me know with your comment. >> >> >> >> Regards >> >> Parmeshwr Prasad >> >> >> >> *From:* Gao, Liming [mailto:liming.gao@intel.com ] >> *Sent:* Friday, January 24, 2014 8:01 PM >> *To:* Prasad, Parmeshwr >> *Subject:* RE: edk2/edksetup.sh patch to solve command line parameter >> >> >> >> Yes. If user follows it, it should work. So, I expect the behavior is: >> >> 1. No parameter, edksetup.sh will set up environment. >> >> 2. BaseTools parameter, edksetup.sh will set up environment. >> >> 3. Other parameter, edksetup.sh will print help message. >> >> >> >> Thanks >> >> Liming >> >> *From:* Parmeshwr_Prasad@Dell.com [mailto:Parmeshwr_Prasad@Dell.com] >> >> *Sent:* Friday, January 24, 2014 7:10 PM >> *To:* Gao, Liming >> *Subject:* RE: edk2/edksetup.sh patch to solve command line parameter >> >> >> >> Hi Liming >> >> >> >> I got your point. I saw user manual do we give any other parameter except >> "*BaseTools"* >> >> In parameter to edksetup.sh ? >> >> >> >> If I am not wrong than this is the point you are talking about. >> >> *ln -s /home/usr/BaseTools /home/usr/Edk2Workspace/Conf/BaseToolsSource* >> >> 4. Run "*. edksetup.sh BaseTools*" under the workspace's directory to set >> >> system environment, such as WORKSPACE, EDK_TOOLS_PATH etc. >> >> >> >> Regards >> >> Parmeshwr >> >> >> >> *From:* Prasad, Parmeshwr >> *Sent:* Friday, January 24, 2014 4:26 PM >> *To:* edk2-devel@lists.sourceforge.net; liming.gao@intel.com >> >> *Subject:* Re: [edk2] edk2/edksetup.sh patch to solve command line >> parameter >> >> >> >> Hi Liming, >> >> >> >> See below two example- >> >> >> >> >> >> 1- param@param-opensource:~/Development/edk2$ source edksetup.sh -h- >> >> Loading previous configuration from $WORKSPACE/Conf/BuildEnv.sh >> >> WORKSPACE: /home/param/Development/edk2 >> >> EDK_TOOLS_PATH: /home/param/Development/edk2/BaseTools >> >> >> >> *In above example edksetup.sh is not able to handle "-h-" parameter it >> mean it can handle only "-?, -h,--help".* >> >> *If we give any other parameter except above mentioned. It cannot handle. >> It mean error handling is required.* >> >> *Even the help message is not looking good.* >> >> >> >> >> >> 2- param@param-opensource:~/Development/edk2$ source edksetup.sh -h >> >> BaseTools Usage: '. edksetup.sh' >> >> >> >> Please note: This script must be 'sourced' so the environment can be >> changed. >> >> (Either '. edksetup.sh' or 'source edksetup.sh') >> >> >> >> This is expected behavior. >> >> >> >> If this patch is not looking good, suggest me how it can be made better. >> >> >> >> Regards >> >> Parmeshwr >> >> >> >> >> >> *From:* Gao, Liming [mailto:liming.gao@intel.com ] >> *Sent:* Friday, January 24, 2014 3:06 PM >> *To:* Prasad, Parmeshwr >> *Cc:* edk2-devel@lists.sourceforge.net >> *Subject:* Re: [edk2] edk2/edksetup.sh patch to solve command line >> parameter >> >> >> >> Hi, >> >> I have two comments. >> >> 1. BaseTools parameter is required to be supported for >> compatibility, because this usage is mentioned in EDKII_UserManual.pdf >> document. Some users have used it. In fact, ". edksetup.sh BaseTools" is >> same to ". edksetup.sh". >> >> 2. In below script, BaseTools/BuildEnv $* can be cleanup to remove >> $*, because no parameter is required. >> >> >> >> if [ -z "$WORKSPACE" ] >> >> then >> >> . BaseTools/BuildEnv $* >> >> else >> >> . $WORKSPACE/BaseTools/BuildEnv $* >> >> fi >> >> >> >> Thanks >> >> Liming >> >> *From:* Parmeshwr_Prasad@Dell.com [mailto:Parmeshwr_Prasad@Dell.com] >> >> *Sent:* Thursday, January 23, 2014 4:02 PM >> *To:* edk2-commits@lists.sourceforge.net >> *Subject:* edk2/edksetup.sh patch to solve command line parameter >> >> >> >> Hi All, >> >> >> >> I see there is a problem in "edksetup.sh" file. It accept one parameter >> "-?, -h, --help" for printing help message. >> >> If we give any other parameter to this it goes and set old environment >> with help message. Expected behavior should be either to print >> >> The help message or set environment. It is not able to handle any garbage >> parameter. >> >> I am sending patch for this problem, please review and commit to main >> stream. >> >> >> >> Even help message was not clear I changes that also. >> >> >> >> *Incorrect behavior :* >> >> :~/Development/edk2$ source edksetup.sh ---jjdcncn >> >> Loading previous configuration from $WORKSPACE/Conf/BuildEnv.sh >> >> WORKSPACE: /home/param/Development/edk2 >> >> EDK_TOOLS_PATH: /home/param/Development/edk2/BaseTools >> >> >> >> Correct behavior: >> >> :~/Development/edk2$ source edksetup.sh -h >> >> BaseTools Usage: '. edksetup.sh' >> >> >> >> Please note: This script must be 'sourced' so the environment can be >> changed. >> >> (Either '. edksetup.sh' or 'source edksetup.sh') >> >> >> >> Correct behavior: >> >> :~/Development/edk2$ source edksetup.sh >> >> Loading previous configuration from $WORKSPACE/Conf/BuildEnv.sh >> >> WORKSPACE: /home/param/Development/edk2 >> >> EDK_TOOLS_PATH: /home/param/Development/edk2/BaseTools >> >> >> >> >> >> *Best Regards,* >> >> *Parmeshwr Prasad* >> >> Tel : +91-9743262018 >> >> [image: cid:image002.png@01CE781A.38F61FE0] >> >> >> >> >> ------------------------------------------------------------------------------ >> CenturyLink Cloud: The Leader in Enterprise Cloud Services. >> Learn Why More Businesses Are Choosing CenturyLink Cloud For >> Critical Workloads, Development Environments & Everything In Between. >> Get a Quote or Start a Free Trial Today. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/edk2-devel >> >> > ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk >From f15cbde4d459b2859eff3a8d2f62cd41727f886f Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Wed, 29 Jan 2014 16:46:31 +0000 Subject: [PATCH] fixes for new edksetup.sh --- edksetup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/edksetup.sh b/edksetup.sh index 39b76e1..c1b57d7 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -30,6 +30,7 @@ function HelpMsg() echo Please note: This script must be \'sourced\' so the environment can be changed. echo ". edksetup.sh" echo "source edksetup.sh" + return 1 } function SetupEnv() @@ -51,7 +52,6 @@ if [ \ ] then HelpMsg - return else SetupEnv "$*" fi @@ -59,11 +59,14 @@ fi if [ $# -gt 1 ] then HelpMsg - return -elif [ $# -eq 1 ] && [ "$1" != "BaseTool" ] +elif [ $# -eq 1 ] && [ "$1" != "BaseTools" ] then HelpMsg - return fi +RETVAL=$? +if [ $RETVAL -ne 0 ] +then + return $RETVAL +fi SourceEnv "$*" -- 1.7.10.4