From 72dd49d7dd07ba4cae13ee1249fd58550991c188 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Mon, 30 Dec 2019 20:31:24 +0000
Subject: Rename cd/umask to execline-cd/execline-umask, make symlinks, etc.
---
.gitignore | 5 ++--
NEWS | 9 ++++--
configure | 5 ++++
doc/cd.html | 50 ---------------------------------
doc/execline-cd.html | 54 ++++++++++++++++++++++++++++++++++++
doc/execline-umask.html | 50 +++++++++++++++++++++++++++++++++
doc/index.html | 4 +--
doc/posix-cd.html | 23 ++++++++-------
doc/posix-umask.html | 22 +++++++++------
doc/umask.html | 48 --------------------------------
doc/upgrade.html | 6 ++++
package/deps.mak | 12 ++++----
package/targets.mak | 22 +++++++++------
src/execline/cd.c | 16 -----------
src/execline/deps-exe/cd | 1 -
src/execline/deps-exe/execline-cd | 1 +
src/execline/deps-exe/execline-umask | 1 +
src/execline/deps-exe/umask | 1 -
src/execline/execline-cd.c | 16 +++++++++++
src/execline/execline-umask.c | 18 ++++++++++++
src/execline/umask.c | 18 ------------
src/execline/wait.c | 10 +++++++
22 files changed, 217 insertions(+), 175 deletions(-)
delete mode 100644 doc/cd.html
create mode 100644 doc/execline-cd.html
create mode 100644 doc/execline-umask.html
delete mode 100644 doc/umask.html
delete mode 100644 src/execline/cd.c
delete mode 100644 src/execline/deps-exe/cd
create mode 100644 src/execline/deps-exe/execline-cd
create mode 100644 src/execline/deps-exe/execline-umask
delete mode 100644 src/execline/deps-exe/umask
create mode 100644 src/execline/execline-cd.c
create mode 100644 src/execline/execline-umask.c
delete mode 100644 src/execline/umask.c
diff --git a/.gitignore b/.gitignore
index 0631586..7103ade 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
/src/include/execline/config.h
/background
/backtick
-/cd
/define
/dollarat
/elgetopt
@@ -16,6 +15,8 @@
/envfile
/exec
/execlineb
+/execline-cd
+/execline-umask
/exit
/export
/fdblock
@@ -43,6 +44,7 @@
/pipeline
/piperw
/posix-cd
+/posix-umask
/redirfd
/runblock
/shift
@@ -52,4 +54,3 @@
/unexport
/wait
/withstdinas
-
diff --git a/NEWS b/NEWS
index 7ae513e..6e42862 100644
--- a/NEWS
+++ b/NEWS
@@ -5,9 +5,12 @@ In 2.6.0.0
- The dollarat program now has its conflicting -0 and -d options
handled in the conventional way, with rightmost priority.
- - New binary: posix-umask. With --enable-pedantic-posix,
-umask is a symbolic link to posix-umask. And, hopefully, this
-completes the "make execline POSIX-compliant" chapter.
+ - New binary: posix-umask.
+ - cd renamed to execline-cd, umask renamed to execline-umask
+ - With --enable-pedantic-posix, umask is a symbolic link to
+posix-umask and cd is a symbolic link to posix-cd. Without this
+option, umask is a symbolic link to execline-umask and cd is
+a symbolic link to execline-cd.
In 2.5.3.0
diff --git a/configure b/configure
index 39777fe..f2fb757 100755
--- a/configure
+++ b/configure
@@ -494,6 +494,11 @@ fi
echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\""
echo "#define ${package_macro_name}_SHEBANGPREFIX \"$shebangdir/\""
echo
+echo "#undef ${package_macro_name}_PEDANTIC_POSIX"
+if $pposix ; then
+echo "#define ${package_macro_name}_PEDANTIC_POSIX"
+fi
+echo
echo "#endif"
exec 1>&3 3>&-
echo " ... done."
diff --git a/doc/cd.html b/doc/cd.html
deleted file mode 100644
index fe64c19..0000000
--- a/doc/cd.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
- execline: the cd command
-
-
-
-
-
-
-
-execline
-Software
-skarnet.org
-
-
- The cd program
-
-
-cd changes the current working directory to a
-given directory, then executes a program.
-
-
- Interface
-
-
- cd dir prog...
-
-
-
-cd performs a
-chdir()
-system call on dir, then execs into prog....
-
-
- Notes
-
-
- - cd is a standard shell builtin. Be careful if you want to
-use the cd command outside of an execline script
- - When execline has been configured with the --enable-pedantic-posix
-option, the cd binary is actually a symbolic link to the
-posix-cd binary.
-
-
-
-
-
diff --git a/doc/execline-cd.html b/doc/execline-cd.html
new file mode 100644
index 0000000..911eb2a
--- /dev/null
+++ b/doc/execline-cd.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+ execline: the execline-cd command
+
+
+
+
+
+
+
+execline
+Software
+skarnet.org
+
+
+ The execline-cd program
+
+
+execline-cd changes the current working directory to a
+given directory, then executes a program.
+
+
+ Interface
+
+
+ execline-cd dir prog...
+
+
+
+execline-cd performs a
+chdir()
+system call on dir, then execs into prog....
+
+
+ Notes
+
+
+ - By default, execline-cd can also be invoked as cd:
+there is a cd program which is a symbolic link to execline-cd.
+ - When execline has been configured with the --enable-pedantic-posix
+option, the cd binary is a symbolic link to the
+posix-cd binary instead, so a cd command
+in an execline script will invoke posix-cd instead
+of execline-cd.
+ - Existing scripts that call cd will keep working no matter the
+chosen configuration.
+
+
+
+
+
diff --git a/doc/execline-umask.html b/doc/execline-umask.html
new file mode 100644
index 0000000..f01343d
--- /dev/null
+++ b/doc/execline-umask.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+ execline: the execline-umask command
+
+
+
+
+
+
+
+execline
+Software
+skarnet.org
+
+
+ The execline-umask program
+
+
+execline-umask sets the umask (file creation mask),
+then executes a program.
+
+
+ Interface
+
+
+ execline-umask mask prog...
+
+
+
+execline-umask sets the current umask to mask,
+then execs into prog....
+
+
+ Notes
+
+
+- By default, at execline installation time, a umask
+symbolic link is created, pointing to execline-umask.
+
- When execline has been configured with the --enable-pedantic-posix
+option, the umask symbolic link points to the
+posix-umask binary instead.
+ - Existing execline scripts calling umask will keep working
+no matter the chosen configuration.
+
+
+
+
diff --git a/doc/index.html b/doc/index.html
index d93f704..498bb13 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -125,9 +125,9 @@ to your installation: the shebang lines for your system might be something like
(Process state control)
-- The cd program
+- The execline-cd program
- The posix-cd program
-- The umask program
+- The execline-umask program
- The posix-umask program
- The emptyenv program
- The envfile program
diff --git a/doc/posix-cd.html b/doc/posix-cd.html
index 5074658..fc40203 100644
--- a/doc/posix-cd.html
+++ b/doc/posix-cd.html
@@ -40,23 +40,26 @@ not empty, it execs into it.
Notes
- - posix-cd is only available when execline has been configured
-with the --enable-pedantic-posix option, and in this case, the
-cd binary is a symbolic link to it.
+ - When execline has been configured
+with the --enable-pedantic-posix option, the cd
+command is a symbolic link to it. So scripts calling cd
+will use posix-cd. When this configuration option has not
+been given, cd is a symbolic link to
+execline-cd.
- posix-cd fully conforms to the
POSIX
specification. When prog... is not empty, the behaviour of a
cd utility is not specified by POSIX, so posix-cd extends
the spec to be actually useful and usable in an execline program with the same
-interface as the regular execline cd command.
+interface as the regular execline cd command.
- Nobody ever executes or needs the external version (i.e. not a shell
-builtin) of the POSIX cd command. Compared to the regular execline
-cd, posix-cd is uselessly bloated and slow.
-The only reason it exists is that some distributions refuse to package
-execline correctly unless it is strictly POSIX-compliant; the
---enable-pedantic-posix configure option is there to appease them.
+builtin) of the POSIX cd command. Compared to execline's regular cd
+binary, execline-cd, posix-cd is
+uselessly bloated and slow. The only reason it exists is that some
+distributions refuse to package execline correctly unless it is strictly
+POSIX-compliant; the --enable-pedantic-posix configure option is
+there to satisfy their requirements.
-