From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E32471F44D for ; Sat, 20 Apr 2024 21:06:25 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=TlBKNiTZ; dkim=fail reason="signature verification failed" header.d=clisp.org header.i=@clisp.org header.a=ed25519-sha256 header.s=strato-dkim-0003 header.b=fjW5ePDx; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryHuS-0005zg-1f; Sat, 20 Apr 2024 17:06:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryHuP-0005zQ-5E for bug-gnulib@gnu.org; Sat, 20 Apr 2024 17:06:05 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.220]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryHuK-00049t-Dw for bug-gnulib@gnu.org; Sat, 20 Apr 2024 17:06:04 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1713647156; cv=none; d=strato.com; s=strato-dkim-0002; b=WuomdE3AYNhprcMywKz04HZOpM+eg3H/qBVpwSLAyBe5zk1U6ihSSIQuNWW2xq7gbG 7Xov2CAgdhvzL1WSz58JD5JPD+OEvummOfNcPhgrbHtPMDWS1xRKyKE4JsG6ggAWZwmK gmR55NsZZXH7nPJKUupEud/xH6t5YnJbSbzpCSXxWfr1q8r6K8f7NqD7fZL0jVubpvKW Kg4giplR9MXDmIfJCgbgYFPbSkZlZdzI+IWDXejOXew63PyywnY/BWm4Diio3bWdyN+G cb8vwDnG2Z9yQMH7Wz82f1iUp8xCfqGxY9Clpia/7c4JwQqUZAn2155XiDCQBrH0qe9F ulyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1713647156; s=strato-dkim-0002; d=strato.com; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=qwY4wgyFakWzXc0mKndGUliRj5oqxqpxSUvUbCvnbIc=; b=VW5bbSkibXAl57fA52TzXtRb/Gj5kqHMwMQfykX99zwRSb3dyY5XmH0wM4+MnssYsT 3e7HZQDOMXRHXsAkL0PNEuDjFvocGwADgEcF7Vg6Qr8JTMVtY6Tzoqrzo5yaFMksiSVp KrCYjBfa9XHLzAtgX55z1Wrsj30FWiAx//VyImHVmDprudqeM5CqqNnkY3P3geVKzrGN uhyPJK4+m51ap5DTeukfYaBvGZRAQKtSE3W+lk6l95vd3TMzLiDtrtNR2vPT9lpW48I+ sdp3hzPepqgyG5PppISVJlUXk0t8eUJIHszAjZeXih+bbpNPy3InOXD2PSHDjkkXvnXw 8prw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1713647156; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=qwY4wgyFakWzXc0mKndGUliRj5oqxqpxSUvUbCvnbIc=; b=TlBKNiTZJOrSP/Ct6Ik7AR+NCpoXdsH64083+DtGlmMIaw3gaFTVCGyxCaUMmS4spt SdIp6WOU5HZauVMOEH+riLO23egQfHkO3s29ZSYgZIhXpH5PTOrdPPZBkXdMmeNDShyZ GWeZ8/sHd8D43aqXewIuZ1BLwkKVzsL5DI0FvQlXnZRoJNfgRMNMJWCSdqhASTxpKTpd S9POIEWfTav2AIeShZkh8Kqw1bxTTBD8f6xzZ71UwqEffNRiwTkSN8u6rfrVjwbWgrUX LSQOd8G2XzAbzuahBlHoiLWzVXpPHNZThuQKRfaZaNHMqVDQSWYTEgsmKl00+5P7ddbz Pl3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1713647156; s=strato-dkim-0003; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=qwY4wgyFakWzXc0mKndGUliRj5oqxqpxSUvUbCvnbIc=; b=fjW5ePDxjeMdeyR6HPyCl13bG/HTw/Wgw5LdnA/vpG9EHGZ3NrNRfwr7WHWPt2SlE9 yl3KxSuiJPWzG6jrm2Ag== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPAiaPMnJmP1xDOek2uMY1V7OI6Ag==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.3.2 AUTH) with ESMTPSA id N8610003KL5u79F (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sat, 20 Apr 2024 23:05:56 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: gnulib-tool.py: Sort file lists case-sensitively Date: Sat, 20 Apr 2024 23:05:56 +0200 Message-ID: <6113379.oCs69inPJz@nimes> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.220; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org When computing the list of old and new file, gnulib-tool.sh sorts them in ASCII order, i.e. case-sensitively. (gnulib.tool.sh lines 5507 and 5513.) gnulib-tool.py needs to be consistent with that. 2024-04-20 Bruno Haible gnulib-tool.py: Sort file lists case-sensitively. * pygnulib/GLImport.py (GLImport.prepare, GLImport.execute): Omit .lower() call in sort key computation. diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index b38808a353..e65e3e1235 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -943,11 +943,14 @@ def prepare(self) -> tuple[dict[str, list[str]], dict[str, str]]: # Prepare basic filelist and basic old_files/new_files variables. filelist = sorted(set(filelist)) + # Add m4/gnulib-tool.m4 to the file list. It is not part of any module. new_files = filelist + ['m4/gnulib-tool.m4'] old_files = list(self.cache['files']) path = joinpath(destdir, m4base, 'gnulib-tool.m4') if isfile(path): old_files.append(joinpath('m4', 'gnulib-tool.m4')) + # old_files is the list of files according to the last gnulib-tool invocation. + # new_files is the list of files after this gnulib-tool invocation. # Construct tables and transformers. transformers = dict() @@ -965,14 +968,18 @@ def prepare(self) -> tuple[dict[str, list[str]], dict[str, str]]: new_table.append(tuple([dest, src])) old_table = sorted(set(old_table)) new_table = sorted(set(new_table)) + # old_table is a table with two columns: (rewritten-file-name original-file-name), + # representing the files according to the last gnulib-tool invocation. + # new_table is a table with two columns: (rewritten-file-name original-file-name), + # representing the files after this gnulib-tool invocation. # Prepare the filetable. filetable = dict() filetable['all'] = sorted(set(filelist)) filetable['old'] = \ - sorted(set(old_table), key=lambda t: tuple(t[0].lower())) + sorted(set(old_table), key=lambda pair: pair[0]) filetable['new'] = \ - sorted(set(new_table), key=lambda t: tuple(t[0].lower())) + sorted(set(new_table), key=lambda pair: pair[0]) filetable['added'] = [] filetable['removed'] = [] @@ -1046,7 +1053,7 @@ def execute(self, filetable: dict[str, list[str]], transformers: dict[str, str]) pairs = [ f for f in filetable['old'] if f not in filetable['new'] ] - pairs = sorted(set(pairs), key=lambda t: tuple(t[0].lower())) + pairs = sorted(set(pairs), key=lambda pair: pair[0]) files = sorted(set(pair[0] for pair in pairs)) for file in files: path = joinpath(destdir, file)