From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx009.vodafonemail.xion.oxcs.net (mx009.vodafonemail.xion.oxcs.net [153.92.174.39]) by sourceware.org (Postfix) with ESMTPS id ED5343844008 for ; Sun, 4 Oct 2020 10:26:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ED5343844008 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nexgo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Stromeko@nexgo.de Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 4906960636D for ; Sun, 4 Oct 2020 10:26:28 +0000 (UTC) Received: from Gertrud (unknown [84.160.202.5]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 1943F60637A for ; Sun, 4 Oct 2020 10:26:25 +0000 (UTC) From: Achim Gratz To: cygwin-apps@cygwin.com Subject: Re: git repositories for cygwin packaging - please test 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> Date: Sun, 04 Oct 2020 12:26:22 +0200 In-Reply-To: <87sgc4axsp.fsf@Otto.invalid> (ASSI's message of "Sun, 30 Aug 2020 18:44:22 +0200") Message-ID: <878scms2wh.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-VADE-STATUS: LEGIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Sun, 04 Oct 2020 10:26:31 -0000 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. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf rackAttack V1.04R1: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada