Message ID | 20211202070658.2164977-3-raj.khem@gmail.com |
---|---|
State | Dropped |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A93C385C403 for <patchwork@sourceware.org>; Thu, 2 Dec 2021 07:08:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A93C385C403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638428888; bh=fRpRZTb2irRlE0E6yvaAixW0/uhlnoFtgz0m1/H6Eq4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JysSJhFfvZKYcr1MG/UIzbWk/R0OkL48vZZr7VXwjTcGcMgiPDKr3QLxhjDWG1Ga5 CK+/9JIXuhU1HzhjlOO1uJGoBsudwmrQ/bHys9jNvjpsSr6wvvf75Z0vc4aXcQn+k1 ixdP2tMcdccnrzjKhRqxGaPuqQ1FPinBI7OP/HYY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 292B13857C6C for <libc-alpha@sourceware.org>; Thu, 2 Dec 2021 07:07:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 292B13857C6C Received: by mail-pj1-x1031.google.com with SMTP id gb13-20020a17090b060d00b001a674e2c4a8so3870112pjb.4 for <libc-alpha@sourceware.org>; Wed, 01 Dec 2021 23:07:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fRpRZTb2irRlE0E6yvaAixW0/uhlnoFtgz0m1/H6Eq4=; b=v72b1ikDxKaajvFp9iaGyMk8cQE3pH/1rpK83SqzL4uSzYrPCT2BVcAQv6AHt+CMjm VDCLdiAX+6DgTYEozOnCcSdRn78ItyQ7UKtc2JbW5+PZ9EdE6FwQZplud0WJJVkXS1dg s01ShrGUBvpWpZtV7pZokLsCIOOBQAtEZ3Z3YjYat3ZqSrb6FHscIH2Hvsbt1eWKMIC+ wlozXsFPaOYC+v8Dz8rjOMAZzcft5BPxndq/P7W6EhsZke9J7ad0XGH9jhu3WbrkGXhJ UtVGVYIKMUa8XJ6w5Ax//iM1AWGfA7UsbL46zzSTjn5JM4xQkfZ4KKfTES2liFrQsbQp VXrA== X-Gm-Message-State: AOAM531RuYm88x0swYiTONxisoWiV2xkyzSb73vnJFAHeQYZ3WdKXXXR nReuM3YQ5qdZbVIRqRKge83uLqDvdJEs/Q== X-Google-Smtp-Source: ABdhPJxvCytzKjvUnqRwGsLbFo4GR6LFWlhdr5bjFRrBUvq7MW8YYO+SD6G/2qF5mekQ5QcXg2Rh0w== X-Received: by 2002:a17:902:8214:b0:142:61cf:7be with SMTP id x20-20020a170902821400b0014261cf07bemr13424194pln.0.1638428823021; Wed, 01 Dec 2021 23:07:03 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::ce68]) by smtp.gmail.com with ESMTPSA id r6sm1363064pjz.56.2021.12.01.23.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Dec 2021 23:07:02 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH] timezone: re-written tzselect as posix sh Date: Wed, 1 Dec 2021 23:06:58 -0800 Message-Id: <20211202070658.2164977-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202070658.2164977-1-raj.khem@gmail.com> References: <20211202070658.2164977-1-raj.khem@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Khem Raj via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Khem Raj <raj.khem@gmail.com> Cc: Hongxu Jia <hongxu.jia@windriver.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
timezone: re-written tzselect as posix sh
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
dj/TryBot-32bit | success | Build for i686 |
Commit Message
Khem Raj
Dec. 2, 2021, 7:06 a.m. UTC
To avoid the bash dependency. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- timezone/tzselect.ksh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
* Khem Raj via Libc-alpha: > To avoid the bash dependency. > > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> > Signed-off-by: Khem Raj <raj.khem@gmail.com> > --- > timezone/tzselect.ksh | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh > index 18fce27e24..7705df83d7 100755 > --- a/timezone/tzselect.ksh > +++ b/timezone/tzselect.ksh > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/bin/sh > # Ask the user about the time zone, and output the resulting TZ value to stdout. > # Interact with the user via stderr and stdin. > > @@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org > > # Specify default values for environment variables if they are unset. > : ${AWK=awk} > -: ${TZDIR=`pwd`} > +: ${TZDIR=$(pwd)} > > # Output one argument as-is to standard output. > # Safer than 'echo', which can mishandle '\' or leading '-'. Is this really a bashism? I'm surprised. Thanks, Florian
On Thu, Dec 2, 2021 at 7:38 AM Florian Weimer <fweimer@redhat.com> wrote: > > * Khem Raj via Libc-alpha: > > > To avoid the bash dependency. > > > > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> > > Signed-off-by: Khem Raj <raj.khem@gmail.com> > > --- > > timezone/tzselect.ksh | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh > > index 18fce27e24..7705df83d7 100755 > > --- a/timezone/tzselect.ksh > > +++ b/timezone/tzselect.ksh > > @@ -1,4 +1,4 @@ > > -#!/bin/bash > > +#!/bin/sh > > # Ask the user about the time zone, and output the resulting TZ value to stdout. > > # Interact with the user via stderr and stdin. > > > > @@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org > > > > # Specify default values for environment variables if they are unset. > > : ${AWK=awk} > > -: ${TZDIR=`pwd`} > > +: ${TZDIR=$(pwd)} > > > > # Output one argument as-is to standard output. > > # Safer than 'echo', which can mishandle '\' or leading '-'. > > Is this really a bashism? I'm surprised. you are right. I tested it on bash/dash/zsh/ash it works as expected. Let me find the real reason for this patch and come back. > > Thanks, > Florian >
tzselect.ksh is supposed to be taken verbatim from upstream tzcode, not locally modified. See timezone/README.
On 12/1/21 23:06, Khem Raj via Libc-alpha wrote: > To avoid the bash dependency. A better way to avoid any Bash dependency would be to change timezone/Makefile's $(objpfx)tzselect rule to add a line like this: -e 's|#!/bin/bash|#!$(KSHELL)|g' \ where KSHELL is suitably defined for your platform. This is what the upstream (tzcode) Makefile does, and doing it this way would mean that tzselect.ksh could stay identical with upstream. For KSHELL it's better to use Bash or some other Korn-compatible shell if available, since tzselect takes advantage of ksh-style 'select' commands (when the shell supports 'select') to have a somewhat better UI. > -: ${TZDIR=`pwd`} > +: ${TZDIR=$(pwd)} This part of the patch is not relevant to any Bash dependency, since the form with `` should be supported by any POSIX shell. That being said, nowadays tzselect.ksh could be streamlined a bit since we no longer need to worry about compatibility with Solaris 9 sh. I'll try to kick free some time to do that upstream.
diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh index 18fce27e24..7705df83d7 100755 --- a/timezone/tzselect.ksh +++ b/timezone/tzselect.ksh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Ask the user about the time zone, and output the resulting TZ value to stdout. # Interact with the user via stderr and stdin. @@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org # Specify default values for environment variables if they are unset. : ${AWK=awk} -: ${TZDIR=`pwd`} +: ${TZDIR=$(pwd)} # Output one argument as-is to standard output. # Safer than 'echo', which can mishandle '\' or leading '-'.