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 A1A5E1F44D for ; Mon, 15 Apr 2024 11:47:33 +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=sfasZctE; 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=TNPZbdVW; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwKnv-0003mI-Tw; Mon, 15 Apr 2024 07:47:26 -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 1rwKnk-0003ll-B6 for bug-gnulib@gnu.org; Mon, 15 Apr 2024 07:47:10 -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 1rwKnh-0006jC-UF for bug-gnulib@gnu.org; Mon, 15 Apr 2024 07:47:07 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1713181621; cv=none; d=strato.com; s=strato-dkim-0002; b=bqI/0QMrn0IpQjMRGjNCL92gg1lg7N/3rlmUP+2CnR1tMRc9UgAZSIkipwdMdvQ8qg axv2+vTs2AcZoeD+evZlMprC2e9K5y+REFJCxRx2ol/qIGdEGAF377/FcOczDC4XNviY dNocuqZfG0GKkrhQYRK1Hh2rSurKZFN784q9wReScdY/HuRy0w6Mzg1ChEmf67n7MS2G u5b0clE+1db+n3poRu8zgPAtwLHS/IzexrVsQQLmysB+yS8NjYem28Xj+D73qVMkEpOs FJJwYBRHtALy2AvE6jLkQDO0XEjVxs2ZEJ0EG9tYwo4ScKttBQ7LJEDpNyGZ0Er/qvPv F4ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1713181621; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=inzjYP8+kqflrLedknnIFZ7MWJ19lUQp/8PpoF3Mps8=; b=Rner+o1qi2yxnjtLHxwWJXRRknx20/4+g3Co1m5nwfzNrvbAc0VEwut5vaH0sh8xGO d+46qSVzwgHmIJuVUsa7zmfafrmI7CHphvDWCrb5D6ElI+twU1oNlhw15tt/AvIucM9z Xz2pE4K5q9NxA9xWXUb5U9IwtwsJAsfDstpnbtD++YU+aROw7orlDaaFtW3ZWLqfJvoR KGZcz6jEqykeH/DPMWXdy7hKH086kdd9cNCZ6cVGAu/vts13AjCwvr1QAeLoG17JfmKr 4SPcuHHyt8qbwKrePqnCrwbX3RKYGKcLfopj+dvQBKxPLdCcwN5Xwd8EC4EfYocS23dL +ldw== 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=1713181621; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=inzjYP8+kqflrLedknnIFZ7MWJ19lUQp/8PpoF3Mps8=; b=sfasZctE34OekHNRZA0JSABrnlohRDeIRtpK9o0GdLQYhOaDu3pXkDR0ST30K+7a2u 3Z7hrMpheBfUk4ykyzhV6ktK/xLHuj7qAtp9DuPwgYm5jy1qUn99AAFGJ8gWXlpSVFdG YMUFpLP1osZ/NG271OXM9wnzVFRjmIvpoEfUvlsOq3nW69idEFesaitfWxhryqnERuDs mP16NCjggpt/l6F3TJpNGj8GjWj5uBiXaIxw4hDUbTWugf0QGsOdSGhyxPqbBHUSu70M YVTlVDlWx772fIemqh1IjNLsfvpm1L+dX0a2PgGkbToCxtIEEfP8J9rRN1MBfDZbn/6P emuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1713181621; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=inzjYP8+kqflrLedknnIFZ7MWJ19lUQp/8PpoF3Mps8=; b=TNPZbdVWmqGu82sCr/hvPOeh0NKz6Xxze1mvX8f1B8KSh+3nX+J8B4petnsL60ChQe ROr9545Df1PDDh4QvvAw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOV1PKcgbrVmq52JS43gXfHCV+KMw==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.3.2 AUTH) with ESMTPSA id N8610003FBl0kmF (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 15 Apr 2024 13:47:00 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Cc: Collin Funk Subject: Re: gnulib-tool.py: Remove a redundant function. Date: Mon, 15 Apr 2024 13:47:00 +0200 Message-ID: <5642994.VNxaBq3RWB@nimes> In-Reply-To: References: 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 Collin Funk wrote: > The GLImport class has two functions that are the same, > GLImport.rewrite_old_files() and GLImport.rewrite_new_files(). No. When I copy these functions into separate text files and use 'diff' on them: $ diff -u 1 2 --- 1 2024-04-15 06:34:45.441369330 +0200 +++ 2 2024-04-15 06:35:01.941511954 +0200 @@ -1,7 +1,7 @@ - def rewrite_old_files(self, files: list[str]) -> list[str]: - '''Replace auxdir, docbase, sourcebase, m4base and testsbase from default - to their version from cached config.''' + def rewrite_new_files(self, files: list[str]) -> list[str]: + '''Replace auxdir, docbase, sourcebase, m4base and testsbase from + default to their version from config.''' if type(files) is not list: raise TypeError('files argument must has list type, not %s' % type(files).__name__) @@ -9,13 +9,11 @@ if type(file) is not str: raise TypeError('each file must be a string instance') files = sorted(set(files)) - files = [ '%s%s' % (file, os.path.sep) - for file in files ] - auxdir = self.cache['auxdir'] - docbase = self.cache['docbase'] - sourcebase = self.cache['sourcebase'] - m4base = self.cache['m4base'] - testsbase = self.cache['testsbase'] + auxdir = self.config['auxdir'] + docbase = self.config['docbase'] + sourcebase = self.config['sourcebase'] + m4base = self.config['m4base'] + testsbase = self.config['testsbase'] result = [] for file in files: if file.startswith('build-aux/'): > Therefore, we can remove GLImport.rewrite_old_files() and rename > GLImport.rewrite_new_files() to GLImport.rewrite_files(). No. I'm adding 3 unit tests that prove that the patch is wrong, one for each of docbase, sourcebase, testsbase. (For auxdir and m4base gnulib-tool.{sh,py} does not support changing the value while preserving the rest: For auxdir the old files are not removed, for m4base the list of modules gets reset to empty.) Bruno