summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-03-27 17:55:17 +0000
committerKarl Berry <karl@freefriends.org>2011-03-27 17:55:17 +0000
commit7f4e380c647e49fe55fcf84e06d9a2794d8c681e (patch)
treedaa6e583f2b19e18fa84d5e4d451a289e6fc6096 /Master/tlpkg
parentec74682a9401a1797b86c08710ba18a1d0d33b70 (diff)
(version): new fn.
(processOptions, mkMaps): use it. (main): do not unconditionally output version string. git-svn-id: svn://tug.org/texlive/trunk@21848 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-xMaster/tlpkg/dev/updmap.pl28
1 files changed, 14 insertions, 14 deletions
diff --git a/Master/tlpkg/dev/updmap.pl b/Master/tlpkg/dev/updmap.pl
index 84a71af49be..728b30f5211 100755
--- a/Master/tlpkg/dev/updmap.pl
+++ b/Master/tlpkg/dev/updmap.pl
@@ -2,9 +2,10 @@
###############################################################################
# updmap: utility to maintain map files for outline fonts.
#
-# Thomas Esser, (C) 2002. Public domain.
+# Thomas Esser, (C) 2002.
# Fabrice Popineau, for the Perl version.
-#
+# Anyone may freely use, modify, and/or distribute this file, without
+# limitation.
###############################################################################
# $Id$
BEGIN {
@@ -13,13 +14,7 @@ BEGIN {
unshift (@INC, "$TEXMFROOT/tlpkg");
}
-my $svnrev = '$Revision$';
-my $revision;
-if ($svnrev =~ m/: ([0-9]+) /) {
- $revision = "rev. $1";
-} else {
- $revision = "revision number unknown";
-}
+my $version = '$Id$';
use strict;
use TeXLive::TLUtils qw(mkdirhier mktexupd win32);
@@ -243,6 +238,12 @@ sub progname {
}
}
+# return program name + version string.
+sub version {
+ my $ret = sprintf "%s version %s", &progname(), $version;
+ return $ret;
+}
+
###############################################################################
# equalize_file(filename[, comment_char])
# read a file and return its processed content as a string.
@@ -819,7 +820,8 @@ sub processOptions {
"showoptions=s" => \@showoptions,
"nohash" => \$nohash,
"nomkmap" => \$nomkmap,
- "version" => sub {printf "%s, %s", &progname(), $revision; exit(0)},
+ "version" => sub { print &version() . "\n"; exit(0) },
+
"n|dry-run" => \$dry_run,
"copy" => \$copy,
"h|help" => \$opt_help)) {
@@ -943,9 +945,9 @@ sub mkMaps {
open LOG, ">$logfile"
or die "Can't open \"$logfile\"";
$writelog=1;
- print LOG "This is updmap, $revision\n";
+ print LOG &version() . "\n";
printf LOG "%s\n\n", scalar localtime();
- print LOG "Using config file \"$cnfFile\".\n";
+ print LOG "Using config file \"$cnfFile\".\n";
}
sub wlog () {
my $str=shift;
@@ -1162,8 +1164,6 @@ sub main {
&initVars;
&processOptions;
- print "This is updmap, $revision\n" if (! $quiet);
-
if (@showoptions) {
&showOptions(@showoptions);
exit 0;