delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/13/15:56:55

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:reply-to:subject:references:to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=hVNa4kT3B5x3Ct9Q
nD8txRL5JFfJeoZ9XSS1drF8Y40Uydb5Jh3GTOJcV4uqLW1ATmkqjoXsVIG5XjLm
S/cA7MWCNqk8KrwNCltNsf15Kqwjnye4ykBVjTXNCrECgfl1/6Jd9xu46S+KpHLo
VKKkqtLR0iL6ipgzvq3z0z5rkKE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:reply-to:subject:references:to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=uu3qVCNC/qMNhb+KYF+62h
sPFVo=; b=gr2V0IJKzSWlehkWGx9dE0v8ZRN+sIchABJY9VvxI8DIp7/TBvkB+6
6u2FKL9oIwiehZHgmjVZy5/ZbAd60dyXJjQ/Q34IuiVlZ8wpt+3VxzLUkX4U4eNF
v00JfTKzCBa/3tgnmRb22b4i79SmdAvNljlAIySNQRQTtL4Y7CTSA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*MI:sk:8adf161, H*f:sk:8adf161, H*i:sk:8adf161
X-HELO: mail-pf0-f193.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:references:to :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=6EiJ2aEJLmpjL/0l9L6BWnLez2BL8qGDWkj8B+h0I00=; b=HNmTa46u29tNEz1f90hcHIjKMpi4LYkuxIItda4a7+hPdN3cfv93gjN9ioC5RGADUd TwUCTmXFyN5c6m06SG9ZIZtIBOgTzGGkiGhNIr1prQ3lyzZ67nezWatZ4dH6WIOqLKPc brE6GIo85Ng5QNLQ/ok++5MzKhNOVZ19f0ioSv1AVACx/9SjuexwWiY4d2YIO1c4T4mD RSh6+UAgaQuQMObmOeIuTfscNzWioCAU99DcFW03vb3nwMtCViT9pmix4zqR6ORuW0fo zahTyi88eS5ytR46U6HGZwqXftg/iJp2aCbipGPgOrDbX2hb3VDS4wc92l4B4IV7qwWw ILEg==
X-Gm-Message-State: AIkVDXJ74sWbDcgTWvtxc49aWVWY2YaPAyERmY5ZHJPM+f175ZWRK9VozZivDElKo57hug==
X-Received: by 10.84.216.24 with SMTP id m24mr32621779pli.22.1484340992989; Fri, 13 Jan 2017 12:56:32 -0800 (PST)
From: "Matt D." <matt AT codespunk DOT com>
X-Google-Original-From: "Matt D." <codespunk+cygwin AT gmail DOT com>
Reply-To: codespunk+cygwin AT gmail DOT com
Subject: Re: Bash declare built-in regression loses array quotations
References: <587931C1 DOT 5060509 AT gmail DOT com> <8adf1618-02c1-2bb5-042b-24c63046a56e AT redhat DOT com>
To: cygwin AT cygwin DOT com
Message-ID: <58793F00.1090606@gmail.com>
Date: Fri, 13 Jan 2017 15:56:32 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <8adf1618-02c1-2bb5-042b-24c63046a56e@redhat.com>

My scripts have been updated to account for breaking changes in Bash 4.4 
and I have updated all of my Cygwin packages back to the latest version.

I am no longer receiving any assertions. Was I wrong to assume that I 
could selectively roll back Bash to 4.3 as I did?


Matt D.

On 1/13/2017 3:11 PM, Eric Blake wrote:
> On 01/13/2017 02:00 PM, Matt D. wrote:
>> I updated yesterday to the latest Cygwin x86 release which included an
>> updated Bash 4.4.5(1). This release changes the default behavior of the
>> built-in 'declare' command which is causing scripts which relied on this
>> functionality to break.
>>
>> The following test will illustrate the change:
>> declare -A list
>> list[a]=1
>> list[b]=2
>> list[c]=3
>> declare -p | grep list=
>>
>> On Bash 4.4.5(1) the output is:
>> declare -A list=([a]="1" [b]="2" [c]="3" )
>>
>> Previously the result was:
>> declare -A list='([a]="1" [b]="2" [c]="3" )'
>
> This is an intentional upstream behavior change.  Quoting the upstream
> release notes:
>
>>> There are a few incompatible changes between bash-4.3 and bash-4.4.  Bash
>>> now retains the exit status only of asynchronous jobs, as opposed to all
>>> jobs.  This means that it is not possible to use `wait' to retrieve the
>>> status of a previously-completed synchronous command.  Bash no longer
>>> attempts to perform compound assignment if a variable expansion on the
>>> right-hand side of an assignment statement to `declare' or `local' has the
>>> form of a compound assignment.  There are other changes to compound array
>>> assignments used as arguments to the `declare' and `local' builtins, but
>>> those should be backwards compatible, albeit with warning messages about
>>> deprecated constructs.  Read the descriptions of the various compatibility
>>> options in COMPAT or the man page for more details.
> ...
>>> q.  The declare builtin no longer displays array variables using the compound
>>>      assignment syntax with quotes; that will generate warnings when re-used as
>>>      input, and isn't necessary.
>
> Both output forms should produce the same results when re-evaluated;
> except that the form with the extra '' now issues warnings (which is why
> declare -p no longer uses the extra '').
>
>>
>> I can confirm that this has always been the expected output when running
>> this command on Cygwin and Linux. I run CentOS which does not track the
>> latest Bash release and I don't know the procedure to check whether this
>> is an upstream regression or not.
>
> It's not a regression, but an intentional change; you'll have to update
> your script to quit relying on unspecified output.
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019