public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>,
	Tom Tromey <tom@tromey.com>,
	Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH] Automatically update "aclocal_m4_deps" when updating gnulib
Date: Tue, 04 Sep 2018 11:10:00 -0000	[thread overview]
Message-ID: <e1565a9e-fd07-ac4d-8d29-71479a1b4dee@redhat.com> (raw)
In-Reply-To: <8736uq1drt.fsf@redhat.com>

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 <<EOF
>>> +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 <<EOF
>>  .....
>>  $(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,
> 


  reply	other threads:[~2018-09-04 11:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 19:59 [PATCH] Update gnulib to current upstream master Sergio Durigan Junior
2018-08-29 16:19 ` Tom Tromey
2018-08-29 16:29   ` Sergio Durigan Junior
2018-08-29 19:06 ` Pedro Alves
2018-08-29 19:34   ` Sergio Durigan Junior
2018-08-31 13:04     ` Pedro Alves
2018-08-30  0:04   ` Tom Tromey
2018-08-30  3:01     ` Sergio Durigan Junior
2018-08-30 15:57   ` [PATCH] Update gnulib/Makefile.in:aclocal_m4_deps Sergio Durigan Junior
2018-08-30 17:05     ` Simon Marchi
2018-08-30 20:00       ` Sergio Durigan Junior
2018-08-31  7:59         ` Joel Brobecker
2018-08-31 16:02           ` Sergio Durigan Junior
2018-08-31 11:21         ` Pedro Alves
2018-08-31 16:03           ` Sergio Durigan Junior
2018-09-02 21:21           ` [PATCH] Automatically update "aclocal_m4_deps" when updating gnulib Sergio Durigan Junior
2018-09-03 11:15             ` Pedro Alves
2018-09-03 21:18               ` Sergio Durigan Junior
2018-09-04 11:10                 ` Pedro Alves [this message]
2018-09-04 17:58                   ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1565a9e-fd07-ac4d-8d29-71479a1b4dee@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).