summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2017-11-01 07:45:14 +0100
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2017-11-01 07:49:41 +0100
commit983da87847289c7f5373e4d5933d379f211b7613 (patch)
treed326cc75c9d1b9a173331a6141df60a5b734dfc9 /src
parent3c4f5ec5cb933fa4f414ad5b11f7321c5e16fed6 (diff)
Add --version to all installed Perl and Shell scripts.
This option outputs the build info, and for Perl scripts it additionally outputs the Perl version that is running the current script.
Diffstat (limited to 'src')
-rw-r--r--src/OS/Makefile-Base79
-rwxr-xr-xsrc/src/convert4r3.src12
-rwxr-xr-xsrc/src/convert4r4.src12
-rw-r--r--src/src/exicyclog.src5
-rw-r--r--src/src/exigrep.src7
-rwxr-xr-xsrc/src/exim_checkaccess.src8
-rw-r--r--src/src/eximon.src7
-rw-r--r--src/src/eximstats.src8
-rw-r--r--src/src/exinext.src7
-rw-r--r--src/src/exipick.src9
-rw-r--r--src/src/exiqgrep.src9
-rw-r--r--src/src/exiqsumm.src8
-rw-r--r--src/src/exiwhat.src7
-rw-r--r--src/src/transport-filter.src8
14 files changed, 161 insertions, 25 deletions
diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base
index d64ed549f..dcd87c29c 100644
--- a/src/OS/Makefile-Base
+++ b/src/OS/Makefile-Base
@@ -36,9 +36,9 @@ FE = $(FULLECHO)
# are set up, and finally it goes to the main Exim target.
all: utils exim
-config: $(EDITME) checklocalmake Makefile os.c config.h version.h macro.c
+config: $(EDITME) checklocalmake Makefile os.c config.h version.h version.sh macro.c
-checklocalmake:
+checklocalmake:
@if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
$(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
$(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
@@ -260,7 +260,7 @@ buildconfig: buildconfig.c
# Target for the exicyclog utility script
exicyclog: config ../src/exicyclog.src
@rm -f exicyclog
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
@@ -277,6 +277,8 @@ exicyclog: config ../src/exicyclog.src
-e "s?MV_COMMAND?$(MV_COMMAND)?" \
-e "s?RM_COMMAND?$(RM_COMMAND)?" \
-e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exicyclog.src > exicyclog-t
@mv exicyclog-t exicyclog
@chmod a+x exicyclog
@@ -285,13 +287,15 @@ exicyclog: config ../src/exicyclog.src
# Target for the exinext utility script
exinext: config ../src/exinext.src
@rm -f exinext
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
-e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
-e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
-e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exinext.src > exinext-t
@mv exinext-t exinext
@chmod a+x exinext
@@ -300,7 +304,7 @@ exinext: config ../src/exinext.src
# Target for the exiwhat utility script
exiwhat: config ../src/exiwhat.src
@rm -f exiwhat
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
@@ -313,6 +317,8 @@ exiwhat: config ../src/exiwhat.src
-e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
-e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
-e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exiwhat.src > exiwhat-t
@mv exiwhat-t exiwhat
@chmod a+x exiwhat
@@ -321,7 +327,7 @@ exiwhat: config ../src/exiwhat.src
# Target for the exim_checkaccess utility script
exim_checkaccess: config ../src/exim_checkaccess.src
@rm -f exim_checkaccess
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
@@ -329,6 +335,8 @@ exim_checkaccess: config ../src/exim_checkaccess.src
-e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
-e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
-e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exim_checkaccess.src > exim_checkaccess-t
@mv exim_checkaccess-t exim_checkaccess
@chmod a+x exim_checkaccess
@@ -339,7 +347,7 @@ eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
../Local/eximon.conf
@rm -f eximon
$(SHELL) $(SCRIPTS)/Configure-eximon
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
@@ -349,85 +357,108 @@ eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
-e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
-e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
-e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/eximon.src >> eximon
@echo ">>> eximon script built"; echo ""
# Targets for utilities; these are all Perl scripts that have to get the
# location of Perl put in them. A few need other things as well.
-exigrep: Makefile ../src/exigrep.src
+exigrep: config ../src/exigrep.src
@rm -f exigrep
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
-e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
-e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
-e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exigrep.src > exigrep-t
@mv exigrep-t exigrep
@chmod a+x exigrep
@echo ">>> exigrep script built"
-eximstats: Makefile ../src/eximstats.src
+eximstats: config ../src/eximstats.src
@rm -f eximstats
- @sed \
+ @. ./version.sh && sed \
-e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/eximstats.src > eximstats-t
@mv eximstats-t eximstats
@chmod a+x eximstats
@echo ">>> eximstats script built"
-exiqgrep: Makefile ../src/exiqgrep.src
+exiqgrep: config ../src/exiqgrep.src
@rm -f exiqgrep
- @sed \
+ @. ./version.sh && sed \
-e "s?PROCESSED_FLAG?This file has been so processed.?"\
-e "/^# /p" \
-e "/^# /d" \
-e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
-e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exiqgrep.src > exiqgrep-t
@mv exiqgrep-t exiqgrep
@chmod a+x exiqgrep
@echo ">>> exiqgrep script built"
-exiqsumm: Makefile ../src/exiqsumm.src
+exiqsumm: config ../src/exiqsumm.src
@rm -f exiqsumm
- @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ @. ./version.sh && sed \
+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exiqsumm.src > exiqsumm-t
@mv exiqsumm-t exiqsumm
@chmod a+x exiqsumm
@echo ">>> exiqsumm script built"
-exipick: Makefile ../src/exipick.src
+exipick: config ../src/exipick.src
@rm -f exipick
- @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ @. ./version.sh && sed \
+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
-e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
-e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/exipick.src > exipick-t
@mv exipick-t exipick
@chmod a+x exipick
@echo ">>> exipick script built"
-transport-filter.pl: Makefile ../src/transport-filter.src
+transport-filter.pl: config ../src/transport-filter.src
@rm -f transport-filter.pl
- @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ @. ./version.sh && sed \
+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/transport-filter.src > transport-filter.pl-t
@mv transport-filter.pl-t transport-filter.pl
@chmod a+x transport-filter.pl
@echo ">>> transport-filter.pl script built"
-convert4r3: Makefile ../src/convert4r3.src
+convert4r3: config ../src/convert4r3.src
@rm -f convert4r3
- @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ @. ./version.sh && sed \
+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/convert4r3.src > convert4r3-t
@mv convert4r3-t convert4r3
@chmod a+x convert4r3
@echo ">>> convert4r3 script built"
-convert4r4: Makefile ../src/convert4r4.src
+convert4r4: config ../src/convert4r4.src
@rm -f convert4r4
- @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ @. ./version.sh && sed \
+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
../src/convert4r4.src > convert4r4-t
@mv convert4r4-t convert4r4
@chmod a+x convert4r4
@@ -635,7 +666,7 @@ PHDRS = ../config.h \
# Update Exim's version information and build the version object.
-version.h::
+version.h version.sh::
@../scripts/reversion
cnumber.h: version.h
diff --git a/src/src/convert4r3.src b/src/src/convert4r3.src
index 632eb70d7..d0b94d15e 100755
--- a/src/src/convert4r3.src
+++ b/src/src/convert4r3.src
@@ -10,6 +10,18 @@
use warnings;
BEGIN { pop @INC if $INC[-1] eq '.' };
+use Getopt::Long;
+use File::Basename;
+
+GetOptions(
+ 'version' => sub {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+ },
+);
+
##################################################
# Analyse one line #
##################################################
diff --git a/src/src/convert4r4.src b/src/src/convert4r4.src
index fff4e478b..47987fc8f 100755
--- a/src/src/convert4r4.src
+++ b/src/src/convert4r4.src
@@ -9,6 +9,18 @@
use warnings;
BEGIN { pop @INC if $INC[-1] eq '.' };
+use Getopt::Long;
+use File::Basename;
+
+GetOptions(
+ 'version' => sub {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+ },
+);
+
# These are lists of main options which are abolished in Exim 4.
# The first contains options that are used to construct new options.
diff --git a/src/src/exicyclog.src b/src/src/exicyclog.src
index 4fb160ac0..20bf9fcd4 100644
--- a/src/src/exicyclog.src
+++ b/src/src/exicyclog.src
@@ -72,6 +72,11 @@ while [ $# -gt 0 ] ; do
-k) keep=$2
shift
;;
+ --version)
+ echo "`basename $0`: $0"
+ echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION"
+ exit 0
+ ;;
*) echo "** exicyclog: unknown option $1"
exit 1
;;
diff --git a/src/src/exigrep.src b/src/src/exigrep.src
index bdeffae82..118cd91b9 100644
--- a/src/src/exigrep.src
+++ b/src/src/exigrep.src
@@ -6,6 +6,7 @@ BEGIN { pop @INC if $INC[-1] eq '.' };
use Pod::Usage;
use Getopt::Long;
+use File::Basename;
# Copyright (c) 2007-2017 University of Cambridge.
# See the file NOTICE for conditions of use and distribution.
@@ -229,6 +230,12 @@ GetOptions(
-noperldoc => system('perldoc -V 2>/dev/null >&2')
);
},
+ 'version' => sub {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+ },
) and @ARGV or pod2usage;
$pattern = shift @ARGV;
diff --git a/src/src/exim_checkaccess.src b/src/src/exim_checkaccess.src
index a780a298a..81f6ebf70 100755
--- a/src/src/exim_checkaccess.src
+++ b/src/src/exim_checkaccess.src
@@ -65,8 +65,16 @@ PERL_COMMAND - $exim_path $args <<'End'
BEGIN { pop @INC if $INC[-1] eq '.' };
use FileHandle;
+use File::Basename;
use IPC::Open2;
+if ($ARGV[0] eq '--version') {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+}
+
if (scalar(@ARGV) < 3)
{
print "Usage: exim_checkaccess <IP address> <email address> [exim options]\n";
diff --git a/src/src/eximon.src b/src/src/eximon.src
index d461ccffa..6293a7cc2 100644
--- a/src/src/eximon.src
+++ b/src/src/eximon.src
@@ -18,6 +18,13 @@
# X11_LD_LIBRARY
# PROCESSED_FLAG
+#
+if test "x$1" = x--version
+then
+ echo "`basename $0`: $0"
+ echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION"
+ exit 0
+fi
# See if caller wants to invoke gdb
diff --git a/src/src/eximstats.src b/src/src/eximstats.src
index 80ac93372..99f4c195f 100644
--- a/src/src/eximstats.src
+++ b/src/src/eximstats.src
@@ -552,10 +552,18 @@ use integer;
BEGIN { pop @INC if $INC[-1] eq '.' };
use strict;
use IO::File;
+use File::Basename;
# use Time::Local; # PH/FANF
use POSIX;
+if ($ARGV[0] eq '--version') {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+}
+
use vars qw($HAVE_GD_Graph_pie $HAVE_GD_Graph_linespoints $HAVE_Spreadsheet_WriteExcel);
eval { require GD::Graph::pie; };
$HAVE_GD_Graph_pie = $@ ? 0 : 1;
diff --git a/src/src/exinext.src b/src/src/exinext.src
index 9c427350b..913801867 100644
--- a/src/src/exinext.src
+++ b/src/src/exinext.src
@@ -25,6 +25,13 @@ config=
eximmacdef=
exim_path=
+if test "x$1" = x--version
+then
+ echo "`basename $0`: $0"
+ echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION"
+ exit 0
+fi
+
if expr -- $1 : '\-' >/dev/null ; then
while expr -- $1 : '\-' >/dev/null ; do
if [ "$1" = "-C" ]; then
diff --git a/src/src/exipick.src b/src/src/exipick.src
index a1aa79dc0..d486b4289 100644
--- a/src/src/exipick.src
+++ b/src/src/exipick.src
@@ -17,6 +17,7 @@ my $charset = 'ISO-8859-1';
use strict;
BEGIN { pop @INC if $INC[-1] eq '.' };
use Getopt::Long;
+use File::Basename;
my($p_name) = $0 =~ m|/?([^/]+)$|;
my $p_version = "20100323.0";
@@ -83,7 +84,13 @@ GetOptions(
'show-vars=s' => \$G::show_vars, # display the contents of these vars
'just-vars' => \$G::just_vars, # only display vars, no other info
'show-rules' => \$G::show_rules, # display compiled match rules
- 'show-tests' => \$G::show_tests # display tests as applied to each message
+ 'show-tests' => \$G::show_tests, # display tests as applied to each message
+ 'version' => sub {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+ },
) || exit(1);
# if both freeze and thaw specified, only thaw as it is less destructive
diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src
index d900e9933..c26da684b 100644
--- a/src/src/exiqgrep.src
+++ b/src/src/exiqgrep.src
@@ -19,7 +19,9 @@
use strict;
BEGIN { pop @INC if $INC[-1] eq '.' };
+
use Getopt::Std;
+use File::Basename;
# Have this variable point to your exim binary.
my $exim = 'BIN_DIRECTORY/exim';
@@ -44,6 +46,13 @@ if ($^O eq 'darwin') { # aka MacOS X
$base = 62;
};
+if ($ARGV[0] eq '--version') {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+}
+
getopts('hf:r:y:o:s:C:zxlibRca',\%opt);
if ($ARGV[0]) { &help; exit;}
if ($opt{h}) { &help; exit;}
diff --git a/src/src/exiqsumm.src b/src/src/exiqsumm.src
index 99a304fef..97cacdd63 100644
--- a/src/src/exiqsumm.src
+++ b/src/src/exiqsumm.src
@@ -43,6 +43,14 @@
use warnings;
BEGIN { pop @INC if $INC[-1] eq '.' };
+use File::Basename;
+
+if ($ARGV[0] eq '--version') {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+}
sub print_volume_rounded {
my($x) = pop @_;
diff --git a/src/src/exiwhat.src b/src/src/exiwhat.src
index 2542b0198..4fdc09f78 100644
--- a/src/src/exiwhat.src
+++ b/src/src/exiwhat.src
@@ -52,6 +52,13 @@ signal=EXIWHAT_KILL_SIGNAL
# See if this installation is using the esoteric "USE_NODE" feature of Exim,
# in which it uses the host's name as a suffix for the configuration file name.
+if test "x$1" = x--version
+then
+ echo "`basename $0`: $0"
+ echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION"
+ exit 0
+fi
+
if [ "CONFIGURE_FILE_USE_NODE" = "yes" ]; then
hostsuffix=.`uname -n`
fi
diff --git a/src/src/transport-filter.src b/src/src/transport-filter.src
index 3f250e657..256bf7c39 100644
--- a/src/src/transport-filter.src
+++ b/src/src/transport-filter.src
@@ -13,6 +13,14 @@
use warnings;
BEGIN { pop @INC if $INC[-1] eq '.' };
+use File::Basename;
+
+if ($ARGV[0] eq '--version') {
+ print basename($0) . ": $0\n",
+ "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+ "perl(runtime): $^V\n";
+ exit 0;
+}
# If the filter is called with any arguments, insert them into the message
# as X-Arg headers, just to verify what they are.