aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2008-02-15 00:26:26 +0000
committerGunter Knauf <gk@gknw.de>2008-02-15 00:26:26 +0000
commitecc75be6f37448520546f30bfe516068fa0220db (patch)
tree77fb314cb91f4d05c3c2bd04e3481873d6b9cfca
parent13ebf618502aac8cd0ac4b699ce1c2a9574f1731 (diff)
moved info block up before help block so that it can also be displayed before help option; trial to add a version number.
-rwxr-xr-xlib/mk-ca-bundle.pl33
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
index 4a70f715f..a51b2d3cb 100755
--- a/lib/mk-ca-bundle.pl
+++ b/lib/mk-ca-bundle.pl
@@ -41,11 +41,26 @@ my $url = 'http://lxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtin
# If the OpenSSL commandline is not in search path you can configure it here!
my $openssl = 'openssl';
+my $version = '$Revision$';
+
getopts('bhilnqtuv');
+if ($opt_i) {
+ print ("=" x 78 . "\n");
+ print "Script Version : $version\n";
+ print "Perl Version : $]\n";
+ print "Operating System Name : $^O\n";
+ print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n";
+ print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n";
+ print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n";
+ print "LWP.pm Version : ${LWP::VERSION}\n";
+ print ("=" x 78 . "\n");
+}
+
+$0 =~ s/\\/\//g;
+$0 = substr($0, rindex($0, '/') + 1);
if ($opt_h) {
- $0 =~ s/\\/\//g;
- printf("Usage:\t%s [-b] [-i] [-l] [-n] [-q] [-t] [-u] [-v] [<outputfile>]\n", substr($0, rindex($0, '/') + 1));
+ printf("Usage:\t%s [-b] [-i] [-l] [-n] [-q] [-t] [-u] [-v] [<outputfile>]\n", $0);
print "\t-b\tbackup an existing version of ca-bundle.crt\n";
print "\t-i\tprint version info about used modules\n";
print "\t-l\tprint license info about certdata.txt\n";
@@ -57,21 +72,13 @@ if ($opt_h) {
exit;
}
-if ($opt_i) {
- print "Perl Version : $]\n";
- print "Operating System Name : $^O\n";
- printf("MIME::Base64.pm Version : %s\n", $MIME::Base64::VERSION);
- printf("LWP::UserAgent.pm Version : %s\n", $LWP::UserAgent::VERSION);
- print ("=" x 78 . "\n");
-}
-
my $crt = $ARGV[0] || 'ca-bundle.crt';
my $txt = substr($url, rindex($url, '/') + 1);
$txt =~ s/\?.*//;
if (!$opt_n || !-e $txt) {
print "Downloading '$txt' ...\n" if (!$opt_q);
- my $ua = new LWP::UserAgent;
+ my $ua = new LWP::UserAgent(agent => "$0/$version");
my $req = new HTTP::Request('GET', $url);
my $res = $ua->request($req);
if ($res->is_success) {
@@ -106,8 +113,8 @@ print CRT <<EOT;
## '/mozilla/security/nss/lib/ckfw/builtins/certdata.txt'
##
## It contains the certificates in ${format}PEM format and therefore
-## can be directly used with curl / libcurl, or with an
-## Apache+mod_ssl webserver for SSL client authentication.
+## can be directly used with curl / libcurl / php_curl, or with
+## an Apache+mod_ssl webserver for SSL client authentication.
## Just configure this file as the SSLCACertificateFile.
##