From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-043.btinternet.com (mailomta18-sa.btinternet.com [213.120.69.24]) by sourceware.org (Postfix) with ESMTPS id 243F93988831 for ; Fri, 6 Nov 2020 13:53:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 243F93988831 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jon.turney@dronecode.org.uk Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7]) by sa-prd-fep-040.btinternet.com with ESMTP id <20201025181050.YHYZ29410.sa-prd-fep-040.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net> for ; Sun, 25 Oct 2020 18:10:50 +0000 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com X-SNCR-Rigid: 5ED9B66117AF56F0 X-Originating-IP: [86.140.194.67] X-OWM-Source-IP: 86.140.194.67 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedujedrkeeggdduudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepgeeuhfekvdefieeghfehtdejheeigedthefhhfehfffgheehgedtffeljeetueeunecukfhppeekiedrudegtddrudelgedrieejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurdduuddungdpihhnvghtpeekiedrudegtddrudelgedrieejpdhmrghilhhfrhhomhepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeotgihghifihhnqdgrphhpshestgihghifihhnrdgtohhmqe X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.111] (86.140.194.67) by sa-prd-rgout-004.btmx-prd.synchronoss.net (5.8.340) (authenticated as jonturney@btinternet.com) id 5ED9B66117AF56F0 for cygwin-apps@cygwin.com; Sun, 25 Oct 2020 18:10:50 +0000 Subject: Re: git repositories for cygwin packaging - please test To: "cygwin-apps@cygwin.com" References: <20e2f046-af24-14b8-b6c4-263f859042b8@dronecode.org.uk> <181ea3fa-1a50-7db4-0009-47ea9af77cdc@dronecode.org.uk> <5ff5073b-03a7-95e5-6d8b-fbd6436fe1c4@dronecode.org.uk> <63d64107-f2d5-e8b8-b724-20b21eaf9e16@cornell.edu> <87sgc4axsp.fsf@Otto.invalid> <878scms2wh.fsf@Rainer.invalid> From: Jon Turney Message-ID: Date: Sun, 25 Oct 2020 18:10:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <878scms2wh.fsf@Rainer.invalid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3571.3 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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, 06 Nov 2020 13:53:07 -0000 On 04/10/2020 11:26, Achim Gratz wrote: > ASSI writes: >> SCALLYWAG="notest" > > It seems that if I write something like > > SCALLYWAG="notest" # a comment > > then the line actually gets ignored due to a somewhat restrictive regex: > > match = re.search(r'^\s*SCALLYWAG=\s*"?(.*?)"?$', content, re.MULTILINE) > > Something like this might work better: > > match = re.search(r'^\s*SCALLYWAG=\s*"?(.*?)"?(\s*#.*)?$', content, re.MULTILINE) > > (I hope :-). Otherwise you'd first need to chop off any comments at the > end and then shove the result into the original regex. > > It seems like there is a lot of ad-hoc code in that file that does > things slightly differently for various settings, so that seems like it > should get re-factored into something more general that is used > uniformly across all the things you want to extract from the cygport > file. As noted elsewhere, trying to parse variables out of the .cygport like this isn't a good approach, and really I want to add something which gets cygport to execute the file and then output the variables of interest. But I've tweaked things a bit so comments should get discarded before we start looking at the file contents, which hopefully helps this a bit.