[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Mon Jan 25 20:31:18 UTC 2016
The branch master has been updated
via 9ab6fc5936be62f6fee1c433938eae4c89aa23da (commit)
from 52cdc9970de5f0e884d829d8dfa23c89c51527f9 (commit)
- Log -----------------------------------------------------------------
commit 9ab6fc5936be62f6fee1c433938eae4c89aa23da
Author: Richard Levitte <levitte at openssl.org>
Date: Mon Jan 25 21:19:59 2016 +0100
Generate warning text
Now that we're using templates, we should warn people not to edit the
resulting file. We do it through util/dofile.pl, which is enhanced
with an option to tell what file it was called from. We also change
the calls so the template files are on the command line instead of
being redirected through standard input. That way, we can display
something like this (example taken from include/openssl/opensslconf.h):
/* WARNING: do not edit! */
/* Generated by Configure from include/openssl/opensslconf.h.in */
Reviewed-by: Rich Salz <rsalz at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
Configure | 2 +-
Makefile.in | 1 +
apps/CA.pl.in | 4 ++--
apps/Makefile.in | 2 +-
crypto/include/internal/bf_conf.h.in | 1 +
crypto/include/internal/bn_conf.h.in | 1 +
crypto/include/internal/des_conf.h.in | 1 +
crypto/include/internal/rc4_conf.h.in | 1 +
include/openssl/opensslconf.h.in | 2 +-
tools/Makefile.in | 2 +-
tools/c_rehash.in | 2 ++
util/dofile.pl | 16 ++++++++++++++++
12 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/Configure b/Configure
index 2e88a73..d563740 100755
--- a/Configure
+++ b/Configure
@@ -1752,7 +1752,7 @@ sub run_dofile()
my $out = shift;
# should we remove $out ?
- system("$config{perl} -I. -Mconfigdata util/dofile.pl <$in >$out.new");
+ system("$config{perl} -I. -Mconfigdata util/dofile.pl -o\"Configure\" $in > $out.new");
exit 1 if $? != 0;
rename("$out.new", $out) || die "Can't rename $out.new, $!";
}
diff --git a/Makefile.in b/Makefile.in
index e875f43..7db430d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,7 @@
##
## Makefile for OpenSSL
##
+## {- join("\n## ", @autowarntext) -}
VERSION={- $config{version} -}
MAJOR={- $config{major} -}
diff --git a/apps/CA.pl.in b/apps/CA.pl.in
index b54df5e..52a97d7 100644
--- a/apps/CA.pl.in
+++ b/apps/CA.pl.in
@@ -1,8 +1,8 @@
#!{- $config{perl} -}
#
# Wrapper around the ca to make it easier to use
-# Edit CA.pl.in not CA.pl!
-
+#
+# {- join("\n# ", @autowarntext) -}
use strict;
use warnings;
diff --git a/apps/Makefile.in b/apps/Makefile.in
index 290dff6..8d2433b 100644
--- a/apps/Makefile.in
+++ b/apps/Makefile.in
@@ -140,7 +140,7 @@ progs.h: progs.pl Makefile
$(RM) openssl.o
CA.pl: CA.pl.in
- $(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl < CA.pl.in > CA.pl.new
+ $(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -oapps/Makefile CA.pl.in > CA.pl.new
mv CA.pl.new CA.pl
diff --git a/crypto/include/internal/bf_conf.h.in b/crypto/include/internal/bf_conf.h.in
index 5b6e5e7..552faae 100644
--- a/crypto/include/internal/bf_conf.h.in
+++ b/crypto/include/internal/bf_conf.h.in
@@ -1,3 +1,4 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
diff --git a/crypto/include/internal/bn_conf.h.in b/crypto/include/internal/bn_conf.h.in
index a75e964..5ebd55d 100644
--- a/crypto/include/internal/bn_conf.h.in
+++ b/crypto/include/internal/bn_conf.h.in
@@ -1,3 +1,4 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
diff --git a/crypto/include/internal/des_conf.h.in b/crypto/include/internal/des_conf.h.in
index 43ab5eb..2c4369b 100644
--- a/crypto/include/internal/des_conf.h.in
+++ b/crypto/include/internal/des_conf.h.in
@@ -1,3 +1,4 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
diff --git a/crypto/include/internal/rc4_conf.h.in b/crypto/include/internal/rc4_conf.h.in
index 5f23357..b5b2bd3 100644
--- a/crypto/include/internal/rc4_conf.h.in
+++ b/crypto/include/internal/rc4_conf.h.in
@@ -1,3 +1,4 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in
index 3d7137e..f54043a 100644
--- a/include/openssl/opensslconf.h.in
+++ b/include/openssl/opensslconf.h.in
@@ -1,5 +1,5 @@
/* opensslconf.h */
-/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
#ifdef __cplusplus
extern "C" {
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b52b45f..d0c5ca2 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -59,7 +59,7 @@ clean:
errors:
c_rehash: c_rehash.in
- $(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl < c_rehash.in > c_rehash.new
+ $(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -otools/Makefile c_rehash.in > c_rehash.new
mv c_rehash.new c_rehash
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/tools/c_rehash.in b/tools/c_rehash.in
index 912618c..dc66a9d 100644
--- a/tools/c_rehash.in
+++ b/tools/c_rehash.in
@@ -1,5 +1,7 @@
#!{- $config{perl} -}
+# {- join("\n# ", @autowarntext) -}
+
# Perl c_rehash script, scan all files in a directory
# and add symbolic links to their hash values.
diff --git a/util/dofile.pl b/util/dofile.pl
index a6b0905..780759b 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -8,6 +8,8 @@
use strict;
use warnings;
+use Getopt::Std;
+
# Because we know that Text::Template isn't a core Perl module, we use
# a fallback in case it's not installed on the system
use File::Basename;
@@ -74,6 +76,19 @@ sub broken {
undef;
}
+# Check options ######################################################
+
+my %opts = ();
+
+# -o ORIGINATOR
+# declares ORIGINATOR as the originating script.
+getopt('o', \%opts);
+
+my @autowarntext = ("WARNING: do not edit!",
+ "Generated"
+ . (defined($opts{o}) ? " by ".$opts{o} : "")
+ . (scalar(@ARGV) > 0 ? " from ".join(", ", at ARGV) : ""));
+
# Template reading ###################################################
# Read in all the templates into $text, while keeping track of each
@@ -100,6 +115,7 @@ $template->fill_in(OUTPUT => \*STDOUT,
HASH => { config => \%config,
target => \%target,
withargs => \%withargs,
+ autowarntext => \@autowarntext,
quotify1 => \"ify1,
quotify_l => \"ify_l },
DELIMITERS => [ "{-", "-}" ],
More information about the openssl-commits
mailing list