From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by sourceware.org (Postfix) with ESMTPS id B8D1C383D021 for ; Fri, 28 May 2021 16:06:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B8D1C383D021 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([68.147.0.90]) by shaw.ca with ESMTP id mf09lsP2k7YjPmf0AltySM; Fri, 28 May 2021 10:06:22 -0600 X-Authority-Analysis: v=2.4 cv=fPVaYbWe c=1 sm=1 tr=0 ts=60b114fe a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=ejknC5xS72zp2OFXFO8A:9 a=QEXdDO2ut3YA:10 Reply-To: cygwin-apps@cygwin.com To: cygwin-apps@cygwin.com References: <20210526190637.30456-1-jon.turney@dronecode.org.uk> From: Brian Inglis Organization: Systematic Software Subject: Re: [PATCH cygport] Add 'vars' command to output arbitrary .cygport variables Message-ID: <3647e3d7-e04e-598c-4e62-c8098ac5a8a9@SystematicSw.ab.ca> Date: Fri, 28 May 2021 10:06:20 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210526190637.30456-1-jon.turney@dronecode.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfJat6DX5k3mb2CgdG7FOOCdIfqO0KpiKAB4/LBNmHHtlSHw7i5B/Pl4lgLdXb/JUuMBqdZqkstQUJ9tikXIyyLKpT5Pb+Ue7EjtrZPh4LY3AxmkipWMs YzCWs5eWsZcf00g1gbZSHNwiauW1eU44XVyzX1/VRa+W7/szGjgmEfx8TSdSJbV7y/9zAUFwme5LT5sVXzsXlXGl4oCToECq+3c= X-Spam-Status: No, score=-3487.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 16:06:25 -0000 On 2021-05-26 13:06, Jon Turney wrote: > Since variables in a .cygport file can be computed from arbitrary shell > expressions, perhaps containing variables that cygport itself defines, > other programs can't determine their value just by parsing the .cygport > file. > > Add 'vars' command to output arbitrary variables defined by the .cygport > file. > > The idea is that the output from this should be eval-able in a shell to > be further used, but it probably needs some additional escaping (of > newlines?) to be completely right in all cases. > > e.g > >> $ cygport libX11.cygport vars PVR BUILD_REQUIRES >> PVR='1.7.1-1' >> BUILD_REQUIRES='xtrans xorgproto libxcb-devel xmlto xorg-sgml-doctools docbook-xml43' > >> eval $(cygport libX11.cygport vars BUILD_REQUIRES) ; for r in ${BUILD_REQUIRES} ; do echo $r; done bash "declare -p NAME..." seems to do what you want and produce .source-able output: $ ( . mingw64-x86_64-nghttp2/mingw64-x86_64-nghttp2.cygport; declare -p BUILD_REQUIRES DESCRIPTION; echo echo \$BUILD_REQUIRES \$DESCRIPTION) | bash -svx -bash: inherit: command not found declare -- BUILD_REQUIRES="mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2 mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx" + declare -- 'BUILD_REQUIRES=mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2 mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx' declare -- DESCRIPTION="HTTP/2 and its header compression algorithm HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also included are an HTTP/2 client, server, proxy, load test and benchmarking tool, and Python modules. Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in /usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/." + declare -- 'DESCRIPTION=HTTP/2 and its header compression algorithm HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also included are an HTTP/2 client, server, proxy, load test and benchmarking tool, and Python modules. Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in /usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/.' echo $BUILD_REQUIRES $DESCRIPTION + echo mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2 mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx HTTP/2 and its header compression algorithm HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also included are an HTTP/2 client, server, proxy, load test and benchmarking tool, and Python modules. Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in '/usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/.' mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2 mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx HTTP/2 and its header compression algorithm HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also included are an HTTP/2 client, server, proxy, load test and benchmarking tool, and Python modules. Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in /usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/. but eval dislikes the "declare --"! -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]