From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no 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 CB5E51F47C for ; Wed, 11 Jan 2023 04:37:50 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=F+tAgbJy; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFSrm-00061F-MB; Tue, 10 Jan 2023 23:37:34 -0500 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 1pFSrk-000613-TJ for bug-gnulib@gnu.org; Tue, 10 Jan 2023 23:37:32 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFSrj-00018i-1b for bug-gnulib@gnu.org; Tue, 10 Jan 2023 23:37:32 -0500 Received: by mail-pj1-x102b.google.com with SMTP id q64so14624596pjq.4 for ; Tue, 10 Jan 2023 20:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=M+IC9mFgN/wGEzNcrr9IE4miXby+qgJIHwStbA61Km4=; b=F+tAgbJy5akyj1h6/1+XSgwGF91kBXBSe4cNwNJhTI0mPG+Ldb3rsPJgBuq5Rmj3Vq nONFjnlqt+AHL8QxZMoeNLCNHWJKk4fgDxlZsQaBgjdDESrmcw1UCQ9OkdVL5gfCtkpl GJRBHvAMN+EmC2were6vmogYTi2P6fRP2j/vNsXvNIVRq5IMHQsFbB130gmyAjDagVtI coWBBnlIlvq4MelbAz7gtqVX7gsV7AZq2ICXxF+MGyI0WqQi6fDL+6R5OqNwIa+fH0yS f+O2aXJkXqGAjT1b0gQVivcQvzzitHCy8VS0OwIxmWM2hZCM6zc668G8+hNNd85M5B/b DwdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M+IC9mFgN/wGEzNcrr9IE4miXby+qgJIHwStbA61Km4=; b=Bv/6q6ghGqaAMofajWiWuetWk2wvIo5zECipx+ffvNoVev0mykm0+HJRe0nK4HCfZP lrUnXePoFD72oIEH7Ri072qRJZ8dXNHhKJJw5s9yndNFAWSdub4gDqtwGckDM9oIUOII nvLhZQ6GXgM/5oMzUrKg6IqniioPBEhlP8FoVVFQLDNj4fonDfy8VVRB96ECU77fQYE5 OJ1mJTpenYcRaftP/wkFATKm3L+EOqqZ3e9L0L2z7VTZ5C/pFWzSBiAprHFW2/ClDO5s cM8mrn/bkViWF9Hn0CIiLA6Gr7bSgPRCVadb+O++HGYa34Aef+/jcAYIiagMehVRriCb hIYA== X-Gm-Message-State: AFqh2kp2yMIPvl/arqH054YF6Png21aeqBJlfjeAwfQhGheUv9veccpZ GQ2mK2AtS8lsYx9JyUVSX0srFMyfxeY= X-Google-Smtp-Source: AMrXdXuurV8wPu/OfLtFd17VL2tObpOvRncAYweUjZeKXeMSHg0I/DXptrJyFxyk/5noTBHylfRtUw== X-Received: by 2002:a17:902:f691:b0:194:4a8e:7eee with SMTP id l17-20020a170902f69100b001944a8e7eeemr1659541plg.65.1673411847778; Tue, 10 Jan 2023 20:37:27 -0800 (PST) Received: from meyering-mbp ([2620:10d:c090:400::5:8c55]) by smtp.gmail.com with ESMTPSA id b16-20020a170902d51000b0018b025d9a40sm8901241plg.256.2023.01.10.20.37.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 20:37:26 -0800 (PST) From: Jim Meyering To: bug-gnulib@gnu.org Subject: FYI: update-copyright: also work with two or more updatable lines Date: Tue, 10 Jan 2023 20:37:24 -0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=meyering@gmail.com; helo=mail-pj1-x102b.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.096, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 --=-=-= Content-Type: text/plain FYI, I've just pushed this fix. I noticed this bug when attempting to update gzip's copyright dates. It has a few files with two copyright lines. The old version of this script would update only the first one. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=update-copyright.diff >From 7f1b32336b063be3a672e9285f62c6b8ce5eb6e1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 2 Jan 2023 22:52:08 -0800 Subject: [PATCH] update-copyright: also work with two or more updatable lines in a file * build-aux/update-copyright: Replace every occurrence of the copyright line, not just the first one. * tests/test-update-copyright.sh: Add a test case for this. --- ChangeLog | 7 +++++++ build-aux/update-copyright | 4 ++-- tests/test-update-copyright.sh | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 673da843c1..7868d312bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-01-10 Jim Meyering + + update-copyright: also work with two or more updatable lines in a file + * build-aux/update-copyright: Replace every occurrence of the copyright + line, not just the first one. + * tests/test-update-copyright.sh: Add a test case for this. + 2023-01-10 Bruno Haible immutable: Fix initialization failure on Android. diff --git a/build-aux/update-copyright b/build-aux/update-copyright index ce919bac72..99196fceef 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -137,7 +137,7 @@ eval 'exec perl -wSx -0777 -pi "$0" "$@"' if 0; -my $VERSION = '2020-04-04.15:07'; # UTC +my $VERSION = '2023-01-11.04:24'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -280,7 +280,7 @@ if (defined $stmt_re) } # Replace the old copyright statement. - s/$stmt_re/$stmt_wrapped/; + s/$stmt_re/$stmt_wrapped/g; } } else diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh index 377cf8731e..a84ae34512 100755 --- a/tests/test-update-copyright.sh +++ b/tests/test-update-copyright.sh @@ -115,6 +115,10 @@ Copyright (C) 1990-2005, 2007-2009 Acme, Inc. # Copyright (C) 1990-2005, 2007-2009 Free Software # Foundation, Inc. EOF +cat > $TMP.8 < $TMP-stdout 2> $TMP-stderr @@ -157,6 +161,10 @@ Copyright (C) 1990-2005, 2007-2009 Acme, Inc. # Copyright (C) 1990-2005, 2007-2009 Free Software # Foundation, Inc. EOF +compare - $TMP.8 < $TMP-stdout 2> $TMP-stderr -- 2.39.0.132.g8a4e8f6a67 --=-=-=--