[From nobody Thu Jun 25 05:55:00 2020
Received: from sonic313-21.consmr.mail.ir2.yahoo.com ([77.238.179.188])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1glvKx-0006Wk-FC
 for openwrt-devel@lists.openwrt.org; Tue, 22 Jan 2019 12:39:29 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1548160761; bh=TPQH8hG6h1INLL9iKUsnnd4VXEJDMaSjA5pMCTP1gXY=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject;
 b=TM2ho2ofDT9f87pLoptXAueMMd2LG5efGPdHtk5EUdx/gHFJ1IruDhRpKILZqBotcYX8FRFaqkxy2P8k+nru0cGUOmZR1nXI7zGyDRaFz7zrOzHWGmSmiIO6c/HK305vtmi7CCSDBSKeRRK+qvhoS86lS1Up5CvTn9B72WVdKS4Op3lTMD0n83UtAYsIqIYqL8Nv4Cs4fXSURzt7djJLwJ1PyqOq9Cmj+haGBWnB4WOpiDtLfuH+favWKTi81okKq3sMYi8n8SBsjKrQV2ITVMqyN3YQJigULNq+BLhafKH19x3LB++wF1zp0WkWTNHvNLccPUAuGX7fZZb0yRYviw==
X-YMail-OSG: mwsLCsoVM1nLIwvQVDXCvUDH7H1gVUOyttB6Vw_TRMDZexYwZjSqcMkQ6ezAZni
 wYZ_VBiEmid5CyaYqCnXFlJ0G.4XX37bEK7KRsNUIHaolIzzSMjy9OzKuSZrRBj5zqNGAdksmCMt
 kSDCKqGODi4gci7LdravvVLmxRWqbJXRQZau4YkUoE97Cw5s0AYlNjwpUcSTHCW21EL6HhJOte2i
 1k.cuUUy_qfdHLeyt2vHSRFBRJV5ZYsi_QD7UhAyHhhOiRUEruvscN.aTY356dJtYMz6mI9vlHRa
 ovcBX8_KAC9vBbI.FOEyEgcNqmPNvDikGdM2_YhqvJ7RTXddbCTB_8Cb9dKjluSrP2YINsqpNJ0R
 kXmgiMjn7R09_O4IDGv6XM_7kYwSNq.B9kxmg5bZh_vQglw6hYwRmkK9jPw3DcDEoZ2zJ4t3nPyF
 XpALo.ckmp4tIApcH1wKqBFoW.pcHP6LRxKhGXgsFQY9zsZgUxc0t.LMGhHJmblwEdl.YtCwBj0o
 rfCscpq5u3LL8oJeinv6wxmYZjuohfh5UXL4TJz.16eGeqduD0.L8mtRFVUtwsE9frBdxNPyqUwy
 277ox1xu6VvRJgcLCSJM5vQRAyal7TqPxhwZKPZCxiEBszas3TITp2fPAr0HQQ_NIT4YVOroPeW0
 oq3PIqqueCNfrmbirmll4Y27VUuUA8yupV_B8IK.boMzeRVTY.1WM3zGQ2C0SV.piOWYzvz1Ec6n
 IXhVzVqHFkClHU_W8CauZOKELma00JUe47QOxXSjU_XYJpE9LD2_CcqYEGSMgsNPaM7NEKurkRNZ
 eegAdNos85aYF09lMOOPjNL6xQ64Pr.eUJrrEIWgqDlLJN0ziHtJOekYEHp1IjUy1hYQLvyXIPth
 cBcsRZpcW_Wmt7ahGdNPgxRKMEFNhHgWe_ShjFpI93lkWyAxTSjhp6r_Xo3AO5Xl_2gZ3AbW2reV
 iit.p5QGgnuKIWOYHy_hbiqD4yZi8QHf7OknrUn9iRa9B8sBLVHkpzTFCo1K5KNRKI6tBlZPzS2F
 N1ylBjB0XqdoZF4TgZg_J6W92dsyZ66CGPEkC1UaeTsMQdeQUSI0hUN7CSJB0q0i6
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic313.consmr.mail.ir2.yahoo.com with HTTP; Tue, 22 Jan 2019 12:39:21 +0000
Received: from p4FE44306.dip0.t-ipconnect.de (EHLO [192.168.1.137])
 ([79.228.67.6])
 by smtp429.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID
 2aec8163efc734c53e96970fac474cb2; 
 Tue, 22 Jan 2019 12:39:18 +0000 (UTC)
Subject: Re: [OpenWrt-Devel] Invalid revision range
To: Chuanhong Guo &lt;gch981213@gmail.com&gt;
Cc: Yousong Zhou &lt;yszhou4tech@gmail.com&gt;,
 OpenWrt Development List &lt;openwrt-devel@lists.openwrt.org&gt;
References: &lt;4017423.1428440.1548067357906.ref@mail.yahoo.com&gt;
 &lt;mailman.15946.1548067371.2376.openwrt-devel@lists.openwrt.org&gt;
 &lt;CAECwjAirJMc9euh+2K+RBEnh0AsM2wyfxXWPOLd-=n_FgG3qWw@mail.gmail.com&gt;
 &lt;mailman.16138.1548098210.2376.openwrt-devel@lists.openwrt.org&gt;
 &lt;CAJsYDVKYfsvu1frEQR5ui1eMmJ5AW41zDM5d44gOzSSKO4KFtg@mail.gmail.com&gt;
From: &quot;R. Diez&quot; &lt;rdiezmail-openwrt@yahoo.com&gt;
Message-ID: &lt;f84d3c09-cf4e-2b1c-2ea6-774a538c532b@yahoo.com&gt;
Date: Tue, 22 Jan 2019 13:39:17 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: &lt;CAJsYDVKYfsvu1frEQR5ui1eMmJ5AW41zDM5d44gOzSSKO4KFtg@mail.gmail.com&gt;
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20190122_043927_649832_1247C45F 
X-CRM114-Status: GOOD (  11.33  )
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rdiezmail-openwrt[at]yahoo.com)
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [77.238.179.188 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/,
 no trust [77.238.179.188 listed in list.dnswl.org]
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature


&gt;&gt; If Git fails with a &quot;fatal&quot; error inside getver.sh, how come the build does not stop at that point?
&gt; 
&gt; Failed to calculate current revision isn't a &quot;fatal error&quot;. As you can
&gt; see in getver.sh it falls back to reporting an &quot;unknown&quot; version and
&gt; the rest of the buildroot works just fine. A exact revision isn't a
&gt; must during the entire building procedure.
 &gt; [...]

Seeing a fatal error on the build log is not exactly reassuring. I did 
not want to set any OpenWrt revision, so I was not expecting anything 
like this.

What's the impact of building an &quot;unknown&quot; version? Is that part of the 
OpenWrt version string or version information in the end? In that case, 
an &quot;unknown&quot; version is indeed undesirable.

If the user wants to set a particular version, that's fine. But if he 
does not, and determining the current version from Git fails, the script 
should not just ignore it.

The script is too brittle. Ignoring errors is usually a bad idea. Maybe 
next time it will be something else that fails and goes unnoticed. From 
the reactions I got, I suspect other such scripts in OpenWrt are also 
like this. Such brittle scripts have given me grief in the past.

If there is interest, I can make getver.sh and maybe others more robust, 
and fix any ShellCheck warnings along the way.

About getver.sh, I do not like the idea that you try Git first, and then 
Mercurial. This is rather nondeterministic. Either you are using one, or 
the other. Something like GET_VERSION_FROM=git (as default) or 
GET_VERSION_FROM=mercurial would probably be better.

Best regards,
   rdiez

]