From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9948 invoked by alias); 4 Sep 2018 11:10:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7778 invoked by uid 89); 4 Sep 2018 11:08:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Sep 2018 11:08:49 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 165FF402383E; Tue, 4 Sep 2018 11:08:48 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53EFB1007082; Tue, 4 Sep 2018 11:08:45 +0000 (UTC) Subject: Re: [PATCH] Automatically update "aclocal_m4_deps" when updating gnulib To: Sergio Durigan Junior References: <20180902212100.19034-1-sergiodj@redhat.com> <8736uq1drt.fsf@redhat.com> Cc: GDB Patches , Tom Tromey , Simon Marchi From: Pedro Alves Message-ID: Date: Tue, 04 Sep 2018 11:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8736uq1drt.fsf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00050.txt.bz2 OK. Thanks, Pedro Alves On 09/03/2018 10:17 PM, Sergio Durigan Junior wrote: > On Monday, September 03 2018, Pedro Alves wrote: > >> On 09/02/2018 10:21 PM, Sergio Durigan Junior wrote: >>> When we update gnulib using our "update-gnulib.sh" tool, it doesn't >>> automatically update the list of M4 files present at >>> gnulib/Makefile.in:aclocal_m4_deps. This patch extends the tool to do >>> that. It also puts "aclocal_m4_deps" in its own file (a Makefile >>> fragment), so that it's easier to update it programatically. >>> >>> Tested by generating the file and diff'ing the results against the >>> current version of "aclocal_m4_deps". >> >> Thanks for doing this. > > Thanks for the review. > >> Three remarks below. >> >>> diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh >>> index 3dcafeb3e6..6c10c8a8c4 100755 >>> --- a/gdb/gnulib/update-gnulib.sh >>> +++ b/gdb/gnulib/update-gnulib.sh >>> @@ -167,3 +167,9 @@ if [ $? -ne 0 ]; then >>> exit 1 >>> fi >>> >>> +# Update aclocal-m4-deps.mk >>> +cat > aclocal-m4-deps.mk <>> +aclocal_m4_deps = \\ >>> + configure.ac \\ >>> +$(find import/m4 -type f -name "*.m4" | sed 's/^/\t/; s/$/ \\/; $s/ \\//g') >>> +EOF >> >> #1 >> >> I'd find it a little better to make it so that the new file only includes >> the M4 files, and leave adding configure.ac to Makefile.in. I.e., put >> the m4 files list in a different variable here and them do something like: >> >> # Fill in $m4_files >> include $(srcdir)/m4-files.mk >> >> aclocal_m4_deps = configure.ac $m4_files >> >> in Makefile.in, or, tweak the rule to include configure.ac directly: >> >> $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ configure.ac $(m4_files) > > Done. > >> I think it'll be good practice to generate the file to a temporary >> name, and then use move-if-change to atomically update the destination, >> in case someone Ctrl-Cs just while the script is halfway generated. >> >> I.e.: >> >> cat > foo.mk.tmp <> ..... >> $(srcdir)/..../move-if-change foo.mk.tmp foo.mk > > Done. > >> #3 >> >> Could you also make the script emit a header in the new file that >> reads: >> >> # THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro: >> >> That would make emacs and vi open the file in read-only mode. > > Done. > > Here's the updated version of the patch. > > Thanks, >