Received: from pmta31.teksavvy.com (pmta31.teksavvy.com [76.10.157.38]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 410B47810E6 for <~alpine/devel@lists.alpinelinux.org>; Sat, 2 Jul 2022 06:12:48 +0000 (UTC) IronPort-SDR: WKXBybjPeKIheAx0ndILHla//C1C97aA2bbWHpXuuLpObLIANEGxyhvjcKmGSpw2i3iR3OBVIa QwIO73NaoySg== IronPort-PHdr: =?us-ascii?q?A9a23=3AbgHViRemrP5lA9xU8yQ8j4GMlGM/QIqcDmcuA?= =?us-ascii?q?tIPlL9EcqO449L+MU/E7OtznRnCWoCIjpAMw6Ke++ioEXcY78OZuWsZONxXW?= =?us-ascii?q?hkJhN9evjRoAdXNUBWkaqe1PmpgRJoEDg4kt2q+LVATHc//Y1PIpXjn4TAeA?= =?us-ascii?q?gj1MQt+Dvv0HoLOgs+32Omo95DVJQ5BzCG4fas0LBiyqlDi75hMx9I8euBqj?= =?us-ascii?q?EKZ804gRg=3D=3D?= IronPort-Data: =?us-ascii?q?A9a23=3AONMijqibPytInpZIWrBE87qHX161vRIKZh0uj?= =?us-ascii?q?C45NGQN5FlHY01jehtvCziAP//YNjSjL9p/bY219E4OvZXcxtVjQVZtrik9F?= =?us-ascii?q?X4W8JqUDtmwEBz9bniYRiHhoOKLzCm/huEtpanYd1eEzvuWGuWn/CMUOZ2gH?= =?us-ascii?q?OKmUrabYnopHGeIdQ944f5ds79h6mJXqYXha++9kYuaT/z3YDdJ6RYtWo4nw?= =?us-ascii?q?/jrRCdUgRjHkGhwUmrSxRx8lAS2e3E9VPrzLEwqRpfyatE88uWSH44vwFwll?= =?us-ascii?q?49wEspENz+rrlr7WhVirr/6IgWEin1NR+6+jxtZrzIsw+AwM/90hUV/0W3Px?= =?us-ascii?q?o0ojooW88XpFW/FPYWV8AgZexVWHzljN6lH85fYIHyzrcGYz0LPaXfhxbNlB?= =?us-ascii?q?SnaOKVBqrktXT4TpKRwxDclK0rra/iN6LSwTfFlrs0nNMjtMYcevGxwizbDA?= =?us-ascii?q?p4OV5nHW6TM6JhU0Sk9guhKHO3CfIwQbSJuahnEYhtSKhEQEp1WoQsCrhETa?= =?us-ascii?q?BVHpViVorErpXTezxd4zqb8dtHSf7S3qQxuth7wjgr7E67RW3n27OCi9Ac?= =?us-ascii?q?=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A3PFQP6yJPU2SMMay52X/KrPwD71zdoMgy1?= =?us-ascii?q?knxilNoHxuH/BwWfre+MjzpiWE6gr5P0tQ4uxoWZPwOU80kKQe3WB/B9mftW?= =?us-ascii?q?XdyQ2VxcRZnPLfKl7behEWlNQz6U4IScEXY+EcFWIXsS+52njeLz9K+qjlzE?= =?us-ascii?q?nHv5a6854gd2FXgyYL1XYCNu4ceHcGOTV7OQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2G/BABq4b9i/3JJlxRagQmBT4IkgQG?= =?us-ascii?q?BBAdMhE+RDQOEJJYUZoNSCwEBAQEBAQEBAQk5CQQBAQMBAoQ5RQKFTCc3Bg4?= =?us-ascii?q?BAgQBAQESAQEBBQEBAQEBBwQCAoEYhWgNgzEiVgEBAQEBAQEBAScCAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBAQEBARYCDVIkQgEBAQECASMPAQ0BASwLAQQLCQIOCgICJgI?= =?us-ascii?q?CVwYNBgIBAYJ5AYJ1IxKQf5saeoExgQGCCAEBBoE/AYYmCYERLYYfGUeHfEO?= =?us-ascii?q?CDYE8DIJ3PoJiBIU0gmWXe4I3JgQPAxotLxKBH24BCAQDAwcKBTAGAgwYFAQ?= =?us-ascii?q?CExJTHAISBQcKGw4UHCQXDA8DEgMRAQcCCRIIFSsIAwIDCAMCAyALAgMWCQc?= =?us-ascii?q?KAx0IChwSEBQCBBEeCwgDGR4sCQIEDgNACAsKAxEEAxMYCRYIEAQGAwgvDSc?= =?us-ascii?q?LAxQNAQYDBgIFBQEDIAMUAwUk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FgIGBAUCBAQWAhAIAggnFwcTGBsZAQVZEAkhH?= =?us-ascii?q?AofCgYFBhUDIW0FCjsPKDQ2PCwfGwqBGiwrFgMEBAMCBhoDAyICECkGMgMVB?= =?us-ascii?q?i0VFREoARsCm06BAgZLIQIKHA4CBRsCDVEwFRqBGI5jgz4erk8HA4NOiUOBX?= =?us-ascii?q?pRgBhMtg3WBUIpzhjIwkUqSFYRfjTKUTgcghRyBd4IAgUCCaAkKPhkPkT6Fa?= =?us-ascii?q?IE9hClZAjkCBgEKAQEDCY8FAQE?= X-IronPort-AV: E=Sophos;i="5.92,239,1650945600"; d="scan'208";a="187247590" Received: from webhost.teksavvy.com ([20.151.73.114]) by hsmtp13.teksavvy.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Jul 2022 02:12:46 -0400 Received: from [192.168.3.189] (107-179-206-29.cpe.teksavvy.com [107.179.206.29]) by webhost.teksavvy.com (Postfix) with ESMTPSA id 4EABE3231805; Sat, 2 Jul 2022 02:12:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wildtechgarden.ca; s=default; t=1656742366; bh=bE3Uuynyc6IR3f1i0gBOStt0pMme3jk/GQgf8M3RVmg=; h=Subject:To:From; b=we/2TKHf8cQA+EiJaFPesF0JFM2mcqzONkdo/VKzczBnp7yghcGAR/iZ/1lf0qyW8 DlNiSnjUORtCyxyj90Gua48dU3+VnqYB44Wtii+culV/Vwtd0PQogMaIRx09RJlZEP /kLcjnsah79pj1ebmrOvXPZkOM5O0eBasLRofQaQ= Authentication-Results: webhost.teksavvy.com; spf=pass (sender IP is 107.179.206.29) smtp.mailfrom=dfdpublic@wildtechgarden.ca smtp.helo=[192.168.3.189] Received-SPF: pass (webhost.teksavvy.com: connection is authenticated) Message-ID: <13b60f0f-3095-49b9-5553-91963aebe319@wildtechgarden.ca> Date: Sat, 2 Jul 2022 02:12:45 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Fixing shell script libraries like /lib/libalpine.sh Content-Language: en-CA To: Natanael Copa Cc: ~alpine/devel@lists.alpinelinux.org References: <4caa8c5f-7ebf-ad2f-0e92-29428785fe60@wildtechgarden.ca> <20220701112124.7cd30d2e@ncopa-desktop.lan> From: "Daniel F. Dickinson" In-Reply-To: <20220701112124.7cd30d2e@ncopa-desktop.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <20220702061246.10410.57811@webhost.teksavvy.com> X-PPP-Vhost: wildtechgarden.ca On 2022-07-01 5:21 a.m., Natanael Copa wrote: > On Thu, 30 Jun 2022 02:16:49 -0400 > "Daniel F. Dickinson" wrote: > >> Hello, >> >> I've noticed some issues with the Alpine shell script libraries (one >> example below)[1] >> >> I'm new to Alpine but not to Linux, *BSD, or (way back) Ultrix, and have >> not (yet) dug into the Alpine code base and infrastructure. (Although I >> have my 'notes-to-self' documentation[2] that I intend (RSN...) to >> integrate into the Wiki and have published on my website). >> >> My questions with respect to the issues mentioned are: >> >> 1. Do you prefer the GitLab merge request interface or the mailing list >> for patches?[3] > gitlab. > >> 2. If you are not already using tools like shellcheck / shellfmt and or >> shell unit tests in your CI, do you have objections to such being added? > as long as it does not Er, I presume you meant to complete that thought? I hope my response to Jakub clarifies what I'm thinking, and might address the concern you were going to express. > >> I'm hoping to spend some time fixing this type of issue as they result >> in annoying hiccups when trying to automate setup-alpine, and I'd like >> that to work well. > I'm working on the testsuite to add tests to make sure setup-alpine > works with an "answer file". Awesome! I saw you pushed them in Gitlab recently. I look forward to trying them out. >> A final note: I've got some cloud-init image creation using Packer >> that I soon intend to push to public repository, along with Terraform >> usage of the same; is there interest in those here? I almost forgot; >> what is the status the work on the 'tiny' cloud-init substitute or >> other alternatives in Alpine? > I intend to make some kind of tiny-cloud nocloud provider, which will > be able to take some sort of cloud-init compatible config for > unattended installs. Sounds good. If I can help, please let me know. > >> Regards, >> >> Daniel >> >> >> [1]: >> >> # test the first argument against the remaining ones, return success >> on a match >> isin() { >>     local _a=$1 _b >>     shift >>     for _b; do >>         [ "$_a" = "$_b" ] && return 0 >>     done >>     return 1 >> } >> >> _b is never assigned a value. > This is not true. Yes, I read it wrong. As you point out it was a different issue, and you have fixed both the docs and the setup-ntp issue that were the real culprits. > for _b; do ... > > is equivalent to > > for _b in "$@"; do ... > > So `isin "$resp" busybox openntpd chrony none abort; do` will iterate over > "busybox openntpd chrony none abort" and return 0 (success) if $resp is > in the listed options or 1 (failure) otherwise. > > See > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_03 > >> This is why automating ntp setup fails >> (specifically the following code in /sbin/setup-ntp) will never skip >> the 'ask': >> >> while [ $# -eq 0 ] && ! isin "$resp" busybox openntpd chrony none abort; do >>     ask "Which NTP client to run? ('busybox', 'openntpd', 'chrony' or >> 'none')" chrony >> done > I believe there is other problem. > (I noticed you filed a bug. I will have a look at it) > > -nc Regards, Daniel -- https://wildtechgarden.ca Technical and professional website https://princesandmadmen.ca Personal and political blog