From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36559 invoked by alias); 13 Jan 2017 20:56:36 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 36527 invoked by uid 89); 13 Jan 2017 20:56:36 -0000 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 Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 20:56:34 +0000 Received: by mail-pf0-f193.google.com with SMTP id f144so9781981pfa.2 for ; Fri, 13 Jan 2017 12:56:34 -0800 (PST) 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) Received: from [10.0.1.127] (ip72-209-49-95.ri.ri.cox.net. [72.209.49.95]) by smtp.gmail.com with ESMTPSA id h4sm16798182pfk.96.2017.01.13.12.56.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 12:56:32 -0800 (PST) From: "Matt D." X-Google-Original-From: "Matt D." Reply-To: codespunk+cygwin@gmail.com Subject: Re: Bash declare built-in regression loses array quotations References: <587931C1.5060509@gmail.com> <8adf1618-02c1-2bb5-042b-24c63046a56e@redhat.com> To: cygwin@cygwin.com Message-ID: <58793F00.1090606@gmail.com> Date: Fri, 13 Jan 2017 20:56:00 -0000 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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-01/txt/msg00154.txt.bz2 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