From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64977 invoked by alias); 13 Jan 2017 20:11:33 -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 64914 invoked by uid 89); 13 Jan 2017 20:11:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2398, displays, intentional, compound X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 20:11:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D544A2B5F81 for ; Fri, 13 Jan 2017 20:11:22 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0DKBMlO023925 for ; Fri, 13 Jan 2017 15:11:22 -0500 Subject: Re: Bash declare built-in regression loses array quotations To: cygwin@cygwin.com References: <587931C1.5060509@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: <8adf1618-02c1-2bb5-042b-24c63046a56e@redhat.com> Date: Fri, 13 Jan 2017 20:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <587931C1.5060509@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K1wT5v4dsJGsvnlNECvbcMuK7fJBltiIA" X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00152.txt.bz2 --K1wT5v4dsJGsvnlNECvbcMuK7fJBltiIA Content-Type: multipart/mixed; boundary="5wVgoUiHhTVq81pNOcEqu3icaqjeXtquR"; protected-headers="v1" From: Eric Blake To: cygwin@cygwin.com Message-ID: <8adf1618-02c1-2bb5-042b-24c63046a56e@redhat.com> Subject: Re: Bash declare built-in regression loses array quotations References: <587931C1.5060509@gmail.com> In-Reply-To: <587931C1.5060509@gmail.com> --5wVgoUiHhTVq81pNOcEqu3icaqjeXtquR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2408 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. >=20 > The following test will illustrate the change: > declare -A list > list[a]=3D1 > list[b]=3D2 > list[c]=3D3 > declare -p | grep list=3D >=20 > On Bash 4.4.5(1) the output is: > declare -A list=3D([a]=3D"1" [b]=3D"2" [c]=3D"3" ) >=20 > Previously the result was: > declare -A list=3D'([a]=3D"1" [b]=3D"2" [c]=3D"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 t= he >> 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 compatibili= ty >> options in COMPAT or the man page for more details.=20 ... >> q. The declare builtin no longer displays array variables using the com= pound >> assignment syntax with quotes; that will generate warnings when re-u= sed 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 ''). >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5wVgoUiHhTVq81pNOcEqu3icaqjeXtquR-- --K1wT5v4dsJGsvnlNECvbcMuK7fJBltiIA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYeTRoAAoJEKeha0olJ0NqGrEH/2zQHiZA5FReaO8e1e8eniFC 56Vq+JTNJJ0p7Dz2N2OjMRNd+zU6uBxjQ7Whg5MAxFtVUbJH4yYdwUg1b/aGHsps 2ubdvb2pfbEuRXU4sHkYXIgjeKbzBhgVkhcFiTsjKPfA0gqYXD4piGRKfXZJiGpu HGpKAm+QPSFViduD9GGDFchPORAs4Os7dQvkkIKiSCzvwMYxnj23O7JRF1gl3fmO CyDF4h1oHWnfipSXmmAL6J7reSjtY32spH7ccur7957m0J+0azjyglvJmoolf+oq Bw17sUPAFES7Y2gtB97h0SLVRvtQcIxGO9ddaAcDBaIAFbkW3C5or7Y48Kr2DDo= =lvRS -----END PGP SIGNATURE----- --K1wT5v4dsJGsvnlNECvbcMuK7fJBltiIA--