From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EF06C433F5 for ; Sat, 20 Nov 2021 12:36:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B285834B9; Sat, 20 Nov 2021 13:36:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1637411786; bh=4m9hp1rOf3Pj7SfVk1xnmyewDVjJhwPH+AAApfOz+rw=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j3jeeJsuqUaFiVE0YzlYVFlGM9ji1VvY8vitFHCTIP/h9d3JieAQjtD9nDoLtDEiR CHTHo3hmDnnu1rELLU+KPgJ9Xj6QR9R9WNAqhaFHbFCGFRApn+bNDCdap3CaFSX7sc j4hej5/xgZ1CBHg1XMZn2hAYOWI5CYZNX5Uo2rGJ4J/GKIUVaehg7VByLOCQEJOKyz s4SGl1PAWFC02+SLDQ4cOBN4bmW0P+osSYZ/EK3XsikRVEIBJid2r8dWVSCFRzyPD1 +uCr+eJwFuDvwVsbM5a/dVolwn6sUYnz17MmFKcHsDboPyTU2u7nG1tgqRMgMWQAA5 ueKweSmv8ehqw== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4558A834B9 for ; Sat, 20 Nov 2021 13:36:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1637411784; bh=4m9hp1rOf3Pj7SfVk1xnmyewDVjJhwPH+AAApfOz+rw=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=QpTdsrjr4qJ6vdSWQleAGuuUPIRKeI9aB4CT5Ec1cHUe7B+3Ck2aIcplgIdG5HeU6 Y7K+gJSNUr1oXx7iYDT13EHTcOfhL1Xl4eI96Gpv0y2H4sJW1Jb+Ao6B+/Cevo0P18 W7iBf20ZPgiwvLwuamsPnCknKxTvi2V2G3O7+xn75zFMcfcZCmQMvH4sb0wpoqVzEb idwppMVywvEqFP4sL1/+gPWF6y43ewJROxkX71PEDlVnp38+pdQZLMmWqSKJnJiLyT 1sNyAeEUyaDTOAiX/6nxpcTxgOH8U57poVqymNnK4klB4i8S0ugXSYDpveVZjPDrLB kLw6/MLox5Xjw== Received: by janitor.denx.de (Postfix, from userid 108) id ED73DA01E0; Sat, 20 Nov 2021 13:36:23 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id CD921A0048; Sat, 20 Nov 2021 13:36:09 +0100 (CET) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id A4E801E17FC; Sat, 20 Nov 2021 13:36:09 +0100 (CET) To: Art Nikpal cc: Simon Glass , Tom Rini , marek.behun@nic.cz, Neil Armstrong , Tom Warren , Andre Przywara , U-Boot Mailing List , u-boot-amlogic@groups.io, Christian Hewitt , Artem Lapkin , Nick Xie , Gouwa Wang , Francis Laniel From: Wolfgang Denk Subject: Re: [PATCH v2 0/2] env: setenv add resolve value option MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: References: <20211119043647.1251416-1-art@khadas.com> <2004466.1637308134@gemini.denx.de> Comments: In-reply-to Art Nikpal message dated "Fri, 19 Nov 2021 17:06:28 +0800." Date: Sat, 20 Nov 2021 13:36:09 +0100 Message-ID: <2235982.1637411769@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear Artem, In message you wrote: > > next examples just demonstrate how its works for already defined env > variables which contain other variables (like storred env variables) Which next examples? > sure I know about this ! see my prev message please . Which exact message are you referring to here? > Why not have this new opportunity ? I think the suggested code is adding more problems than it solves. > > have in mind, as you speak of "deep resolve". But then, I'm first > > missing an explanation (and documentation) of what "deep resolve" > > recurrent resolving for variables Your implementation of recursion has an arbiotrary and undocumented depth limit. Also, I cannot see a way to prevent resolving in case I want to keep something like "$foo" in the result. But that's to be expected from such a non-standard way. Why don't you stick with what "eval" in a standard shell does? > > actually means in this context, i. e. how many levels down you > > evaluat. Oh... the code has "int max_loop = 32;" - this is a > > i think its will be enough It is a reallybad habt to implement code with arbitrary limits, as it will blow into your face (or more likely that of an innocent user) rather sooner than later. It's even worse that this limit is nowhere documented. > 1) this option did not broke any exist compatibilities > 2) there we talk not only about uboot shell, same time will be useful > to have env_resolve for internal c usage, because env_set dont have > this feature I did not say that an "eval" like construct would not be useful. But uncontrolled recursion with an undocumented depth limit is a problem. > yes i'm informed about this plans (and think its happens not so > soon - but i provide some simple elegant solution already) > but again we dont have env_resolve for internal c usage which must be > very useful On the CLI, we use the "run" command to get the desired effect. Yes, this is neither perfect nor elegant. But you can use that in C code as well. > will be easy get useful features via simple solution ( deep resolve > all vars by one line ) I understand what you want, but this is not a good way to solve the problem. I'd really rather see such efforts invested in helping Francis with the hush update - which will make such code unnecessary. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Success in marriage is not so much finding the right person as it is being the right person.