Hi Bruno,

On 5/16/24 1:54 PM, Bruno Haible wrote:
>> Thanks for the guide.
> 
> And also update doc/posix-functions/putenv.texi.
> 
>> Should I update occurrences of 'putenv' to
>> 'putenv-gnu' in dependencies
> 
> Yes. (But this can come in a second commit.)
> 
>> and then mark 'putenv' with the
>> 'obsolete' status? That way './bootstrap' will print a small warning
>> letting people know to change it eventually.
> 
> Mark it as "deprecated", not "obsolete", please. See [1].

Done in the two attached patches. I ran the following in Coreutils:

    ./bootstrap --no-git --skip-po --gnulib-srcdir="$GNULIB_SRCDIR"

and everything worked fine. Notice and correct import, so hopefully no
breakage should occur. :)

Collin
From 5d2987e6ca5a7d06b4135ab17314051d363621f2 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 16 May 2024 15:56:47 -0700
Subject: [PATCH 1/2] Rename module 'putenv' to 'putenv-gnu'.

* modules/putenv-gnu: Renamed from modules/putenv.
(Description): Mention the removal of environment variables.
* modules/putenv-gnu-tests: Renamed from modules/putenv-tests.
* modules/putenv: New file, an indirection to the new module.
* doc/posix-functions/putenv.texi: Mention the new module name.
* NEWS: Mention the change.
---
 ChangeLog                                  | 10 +++++++
 NEWS                                       |  2 ++
 doc/posix-functions/putenv.texi            |  4 +--
 modules/putenv                             | 24 +++++----------
 modules/putenv-gnu                         | 34 ++++++++++++++++++++++
 modules/{putenv-tests => putenv-gnu-tests} |  0
 6 files changed, 56 insertions(+), 18 deletions(-)
 create mode 100644 modules/putenv-gnu
 rename modules/{putenv-tests => putenv-gnu-tests} (100%)

diff --git a/ChangeLog b/ChangeLog
index 8bccdfd2e1..f2bfa4246d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-05-16  Collin Funk  <collin.fu...@gmail.com>
+
+	Rename module 'putenv' to 'putenv-gnu'.
+	* modules/putenv-gnu: Renamed from modules/putenv.
+	(Description): Mention the removal of environment variables.
+	* modules/putenv-gnu-tests: Renamed from modules/putenv-tests.
+	* modules/putenv: New file, an indirection to the new module.
+	* doc/posix-functions/putenv.texi: Mention the new module name.
+	* NEWS: Mention the change.
+
 2024-05-16  Collin Funk  <collin.fu...@gmail.com>
 
 	putenv: Add tests.
diff --git a/NEWS b/NEWS
index 6caf3ad8e1..57540c8375 100644
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,8 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2024-05-16  putenv          This module is renamed to 'putenv-gnu'.
+
 2024-02-21  *printf-posix   These modules no longer support the 'n' directive
                             by default.  In order to keep the 'n' directive
                             enabled, you need to additionally request the
diff --git a/doc/posix-functions/putenv.texi b/doc/posix-functions/putenv.texi
index b0ca4ab8b5..ff06ea5062 100644
--- a/doc/posix-functions/putenv.texi
+++ b/doc/posix-functions/putenv.texi
@@ -4,7 +4,7 @@ @node putenv
 
 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/putenv.html}
 
-Gnulib module: ---
+Gnulib module: putenv-gnu
 
 Portability problems fixed by Gnulib:
 @itemize
@@ -14,6 +14,6 @@ @node putenv
 @itemize
 @end itemize
 
-Extension: Gnulib provides a module @samp{putenv} that substitutes a
+Extension: Gnulib provides a module @samp{putenv-gnu} that substitutes a
 @code{putenv} implementation that can also be used to remove environment
 variables.
diff --git a/modules/putenv b/modules/putenv
index a5a7c8d795..acc0659d8b 100644
--- a/modules/putenv
+++ b/modules/putenv
@@ -1,28 +1,20 @@
 Description:
 putenv() function: change or add an environment variable.
 
+Status:
+deprecated
+
+Notice:
+This module is deprecated. Use the module 'putenv-gnu' instead.
+
 Files:
-lib/putenv.c
-m4/putenv.m4
 
 Depends-on:
-stdlib
-environ         [test $REPLACE_PUTENV = 1]
-free-posix      [test $REPLACE_PUTENV = 1]
-malloc-posix    [test $REPLACE_PUTENV = 1]
+putenv-gnu
 
 configure.ac:
-gl_FUNC_PUTENV
-gl_CONDITIONAL([GL_COND_OBJ_PUTENV], [test $REPLACE_PUTENV = 1])
-AM_COND_IF([GL_COND_OBJ_PUTENV], [
-  gl_PREREQ_PUTENV
-])
-gl_STDLIB_MODULE_INDICATOR([putenv])
 
 Makefile.am:
-if GL_COND_OBJ_PUTENV
-lib_SOURCES += putenv.c
-endif
 
 Include:
 <stdlib.h>
@@ -31,4 +23,4 @@ License:
 LGPL
 
 Maintainer:
-Jim Meyering, glibc
+all
diff --git a/modules/putenv-gnu b/modules/putenv-gnu
new file mode 100644
index 0000000000..be929f60be
--- /dev/null
+++ b/modules/putenv-gnu
@@ -0,0 +1,34 @@
+Description:
+putenv() function: change, add, or remove an environment variable.
+
+Files:
+lib/putenv.c
+m4/putenv.m4
+
+Depends-on:
+stdlib
+environ         [test $REPLACE_PUTENV = 1]
+free-posix      [test $REPLACE_PUTENV = 1]
+malloc-posix    [test $REPLACE_PUTENV = 1]
+
+configure.ac:
+gl_FUNC_PUTENV
+gl_CONDITIONAL([GL_COND_OBJ_PUTENV], [test $REPLACE_PUTENV = 1])
+AM_COND_IF([GL_COND_OBJ_PUTENV], [
+  gl_PREREQ_PUTENV
+])
+gl_STDLIB_MODULE_INDICATOR([putenv])
+
+Makefile.am:
+if GL_COND_OBJ_PUTENV
+lib_SOURCES += putenv.c
+endif
+
+Include:
+<stdlib.h>
+
+License:
+LGPL
+
+Maintainer:
+Jim Meyering, glibc
diff --git a/modules/putenv-tests b/modules/putenv-gnu-tests
similarity index 100%
rename from modules/putenv-tests
rename to modules/putenv-gnu-tests
-- 
2.45.0

From 4374e4c46fdb1ba9a327874ee2f6e479031c4593 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 16 May 2024 16:03:48 -0700
Subject: [PATCH 2/2] unsetenv tests: Update module dependencies.

* modules/unsetenv-tests (Depends-on): Depend on 'putenv-gnu' instead of
the deprecated 'putenv'.
---
 ChangeLog              | 6 ++++++
 modules/unsetenv-tests | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f2bfa4246d..bb2deb6766 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-16  Collin Funk  <collin.fu...@gmail.com>
+
+	unsetenv tests: Update module dependencies.
+	* modules/unsetenv-tests (Depends-on): Depend on 'putenv-gnu' instead of
+	the deprecated 'putenv'.
+
 2024-05-16  Collin Funk  <collin.fu...@gmail.com>
 
 	Rename module 'putenv' to 'putenv-gnu'.
diff --git a/modules/unsetenv-tests b/modules/unsetenv-tests
index e3a62f4133..25442ecfbd 100644
--- a/modules/unsetenv-tests
+++ b/modules/unsetenv-tests
@@ -4,7 +4,7 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
-putenv
+putenv-gnu
 
 configure.ac:
 
-- 
2.45.0

Reply via email to