Simon Josefsson [2025-11-15 16:49 +0100] wrote:
> Bruno Haible <[email protected]> writes:
>> Basil L. Contovounesios wrote:
>>> But 'recursively expanded' variables assigned via = are reexpanded on
>>> every occurrence, so in
>>
>> So, that patch is merely an optimization (since the command has no
>> side effects),

Sure, but it also depends on perspective: the command has no side
effects, but it still accesses the (externally mutable) environment.

>>                and the ChangeLog entry should better say
>>
>>   maintainer-makefile: Optimize repeated executions of the same command.
>
> Seems fine to me too now -- it would have helped to separate the
> NEWS.md-related stuff from other patches.

Right, sorry about that.  I attach the two tangential patches here, and
the two NEWS-related ones in my other reply to Simon.

For future reference: would you have preferred I change the thread
subject, or just describe more clearly which patches serve what purpose?

By the way, is there a project preference between a) starting a new
ChangeLog record for each of my patches even if they share the same
date; vs b) grouping ChangeLog entries that share the same date under
the same heading?  (In Emacs this is controlled by the user option
add-log-always-start-new-record.)

>                                            Thank you Basil for NEWS.md
> support, it is important that we modernize our projects.

You're welcome.  Thank you for your patience and helpful guidance!

-- 
Basil

>From 140ae05bf210c37ffa4651154319e7206d04dff8 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email protected]>
Date: Fri, 14 Nov 2025 19:10:11 +0100
Subject: [PATCH 1/2] announce-gen: Pacify POD errors.

* build-aux/announce-gen: Wrap all =items within =over..=back.
Terminate all C< formatting codes with >, not EOL.
(sizes): Format assignment operator like surrounding code.
(print_locations): Add missing C formatting code.
---
 ChangeLog              |  8 ++++++++
 build-aux/announce-gen | 17 +++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8f1a59c237..152cd15cf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-11-14  Basil L. Contovounesios  <[email protected]>
+
+	announce-gen: Pacify POD errors.
+	* build-aux/announce-gen: Wrap all =items within =over..=back.
+	Terminate all C< formatting codes with >, not EOL.
+	(sizes): Format assignment operator like surrounding code.
+	(print_locations): Add missing C formatting code.
+
 2025-11-14  Paul Eggert  <[email protected]>
 
 	openat2: fix symlink splicing bug
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index c90a33e3b2..8d02f4f5c8 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -35,7 +35,7 @@
 eval 'exec perl -wSx "$0" "$@"'
      if 0;
 
-my $VERSION = '2025-07-30 01:47'; # UTC
+my $VERSION = '2025-11-14 18:29'; # 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
@@ -111,8 +111,9 @@ EOF
   exit $exit_code;
 }
 
+=over
 
-=item C<%size> = C<sizes (@file)>
+=item C<%size = sizes (@file)>
 
 Compute the sizes of the C<@file> and return them as a hash.  Return
 C<undef> if one of the computation failed.
@@ -139,9 +140,9 @@ sub sizes (@)
   return $fail ? undef : %res;
 }
 
-=item C<print_locations ($title, \@url, \%size, @file)
+=item C<print_locations ($title, \@url, \%size, @file)>
 
-Print a section C<$title> dedicated to the list of <@file>, which
+Print a section C<$title> dedicated to the list of C<@file>, which
 sizes are stored in C<%size>, and which are available from the C<@url>.
 
 =cut
@@ -163,7 +164,7 @@ sub print_locations ($\@\%@)
   print "\n";
 }
 
-=item C<print_checksums (@file)
+=item C<print_checksums (@file)>
 
 Print the SHA1 and SHA256 signature section for each C<@file>.
 
@@ -214,7 +215,7 @@ sub print_checksums ($@)
     }
 }
 
-=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
+=item C<print_news_deltas ($news_file, $prev_version, $curr_version)>
 
 Print the section of the NEWS file C<$news_file> addressing changes
 between versions C<$prev_version> and C<$curr_version>.
@@ -720,6 +721,10 @@ EOF
   exit 0;
 }
 
+=back
+
+=cut
+
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
 ## mode: perl
-- 
2.51.0

>From 508469de1da950448800d1036a54bd37a17407a9 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email protected]>
Date: Fri, 14 Nov 2025 23:38:38 +0100
Subject: [PATCH 2/2] maintainer-makefile: Optimize repeated executions of the
 same command.

* top/maint.mk (gnulib_dir): Define as a simply (rather than
recursively) expanded variable, to avoid repeated $(shell)
invocations.
---
 ChangeLog    |  7 +++++++
 top/maint.mk | 13 ++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 152cd15cf7..4760bf540b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-11-15  Basil L. Contovounesios  <[email protected]>
+
+	maintainer-makefile: Optimize repeated executions of the same command.
+	* top/maint.mk (gnulib_dir): Define as a simply (rather than
+	recursively) expanded variable, to avoid repeated $(shell)
+	invocations.
+
 2025-11-14  Basil L. Contovounesios  <[email protected]>
 
 	announce-gen: Pacify POD errors.
diff --git a/top/maint.mk b/top/maint.mk
index 815a23a13e..c0eda134dd 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -64,11 +64,14 @@ VC_LIST =
 
 # You can override this variable in cfg.mk if your gnulib submodule lives
 # in a different location.
-gnulib_dir ?= $(shell if test -n "$(GNULIB_SRCDIR)" && test -f "$(GNULIB_SRCDIR)/gnulib-tool"; then \
-			echo "$(GNULIB_SRCDIR)"; \
-		else \
-			echo $(srcdir)/gnulib; \
-		fi)
+ifeq ($(origin gnulib_dir),undefined)
+  gnulib_dir := $(shell if test -n "$(GNULIB_SRCDIR)" \
+                             && test -f "$(GNULIB_SRCDIR)/gnulib-tool"; then \
+                          echo "$(GNULIB_SRCDIR)"; \
+                        else \
+                          echo $(srcdir)/gnulib; \
+                        fi)
+endif
 
 # You can override this variable in cfg.mk to set your own regexp
 # matching files to ignore.
-- 
2.51.0

Reply via email to