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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EA03C433F5 for ; Fri, 19 Nov 2021 07:49:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DD43E61401 for ; Fri, 19 Nov 2021 07:49:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DD43E61401 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08F0B80EEE; Fri, 19 Nov 2021 08:49:05 +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=1637308145; bh=tHvjRkc0x+mMoxk722HWZTKgZrAXXiwSzRKVeFlL6/s=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AoVVk4b5H62eJKlVWcvo25RW8Nr2xhHjXDKWVoaLZz7Mv8I22jS46YpuOovBzEt/A mACa0gn2TX6SCyIpylq6JKl3ON8OrnB+d4kse7g6Z96xfABYILv3xLmqFJgPYlR326 CkREENanvSofU72SMrAZlNJdGtFmyWGAJ/PUCkA0KNw+7OcVLts1M+pWjlF5oED7UG Ole3LMdyHY4KJADEwBJwXES1qmTkar0iW7xkmxHCF0IefkMWfemN7LukpaT4h37mpc hTH/XUahpWJ3wpY/R0EtB2KQHXUhcEOvjmxROfgN370FZBAdsucz2eemXVbVtyYdCJ 9rm55Sqs9hYXQ== 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 BC73F80EEE for ; Fri, 19 Nov 2021 08:49:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1637308141; bh=tHvjRkc0x+mMoxk722HWZTKgZrAXXiwSzRKVeFlL6/s=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=fSfaAu0B0Jma6gudHbJCx127NGTmBeFRFO3qzlrOxH178gJ+ymgnYMTGIkqcLALdg BS5cp3u8D2LI3iF6SZyGuWN6PkxLwLDJYggUhGhDqjZIy9QMCxQC2V0BOoZh450JgD GAllPvPgEZIWanTNLTIkrYY3FSu+6SCknJcVgo3kdg1qLZUut6aTJMXe7WGpgL+RmT WGsTQdUFd+DL3WBw6bbrp6US1mF89elTHShxVX04/F0xVvTydl6FZXe7nbL6sffGfZ BzLQChhWakZ10zUvXyFhTcuZBfOq15kBve45MWpqqEEw15qJtf1BUtMvKsnKXhzaTC PfBu3Rhbr+UuA== Received: by janitor.denx.de (Postfix, from userid 108) id 6EF77A0237; Fri, 19 Nov 2021 08:49:01 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 169EAA0050; Fri, 19 Nov 2021 08:48:55 +0100 (CET) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 997B51E0CB7; Fri, 19 Nov 2021 08:48:54 +0100 (CET) To: Artem Lapkin cc: sjg@chromium.org, trini@konsulko.com, marek.behun@nic.cz, narmstrong@baylibre.com, twarren@nvidia.com, andre.przywara@arm.com, u-boot@lists.denx.de, u-boot-amlogic@groups.io, christianshewitt@gmail.com, art@khadas.com, nick@khadas.com, gouwa@khadas.com, 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: <20211119043647.1251416-1-art@khadas.com> References: <20211119043647.1251416-1-art@khadas.com> Comments: In-reply-to Artem Lapkin message dated "Fri, 19 Nov 2021 12:36:45 +0800." Date: Fri, 19 Nov 2021 08:48:54 +0100 Message-ID: <2004466.1637308134@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 <20211119043647.1251416-1-art@khadas.com> you wrote: > Add possibility setup env variable with additional resolving vars inside > value. Hm... if you want to evaluate variables, you should not prevent the shell to do that by enclosing them in apostrophes? > Usage examples: > > => setenv a hello; setenv b world; setenv c '${a} ${b}' > => setenv -r d '${c}! ${a}...' > => printenv d > d=hello world! hello... Without any new code added: => setenv a hello; setenv b world; setenv c ${a} ${b} => setenv d ${c}! ${a}... => printenv d d=hello world! hello... I know very well that this does not cover all use cases you might have in mind, as you speak of "deep resolve". But then, I'm first missing an explanation (and documentation) of what "deep resolve" actually means in this context, i. e. how many levels down you evaluat. Oh... the code has "int max_loop = 32;" - this is a limitation mentioned nowhere. And are you really sure this is a clever idea? I am not convinced. If we do something like this, we should not invent a new non-standard way. We should implement standard shell behaviour instead (i. e. for example something like the eval command). > Artem Lapkin (2): > env: setenv add resolve value option > test: env: deep resolve value testing This is one more of the patches that actually try to fix existing problems with our ancient verion of the hush shell. As far as I understand, Francis (added to Cc:) has started working on an update of hush to a current version. We should rather help him with that instead of implementing non-standard workarounds. 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 When choosing between two evils, I always like to take the one I've never tried before. -- Mae West, "Klondike Annie"