diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index f7fe02b1b4f..73662615f9b 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -9,6 +9,7 @@ my $svnrev = '$Revision$'; my $datrev = '$Date$'; my $tlmgrrevision; +my $tlmgrversion; my $prg; if ($svnrev =~ m/: ([0-9]+) /) { $tlmgrrevision = $1; @@ -17,7 +18,7 @@ if ($svnrev =~ m/: ([0-9]+) /) { } $datrev =~ s/^.*Date: //; $datrev =~ s/ \(.*$//; -$tlmgrrevision .= " ($datrev)"; +$tlmgrversion = "$tlmgrrevision ($datrev)"; our $Master; our $ismain; @@ -522,7 +523,7 @@ sub main { } else { # give a short message about usage print " -tlmgr revision $tlmgrrevision +tlmgr revision $tlmgrversion usage: tlmgr OPTION... ACTION ARGUMENT... where ACTION is one of:\n"; for my $k (sort keys %action_specification) { @@ -666,29 +667,45 @@ for the full story.\n"; sub give_version { if (!defined($::version_string)) { $::version_string = ""; - $::version_string .= "tlmgr revision $tlmgrrevision\n"; + $::mrversion = ""; + $::version_string .= "tlmgr revision $tlmgrversion\n"; + $::mrversion .= "revision $tlmgrrevision\n"; $::version_string .= "tlmgr using installation: $Master\n"; + $::mrversion .= "installation $Master\n"; if (open (REL_TL, "$Master/release-texlive.txt")) { - # print first and last lines, which have the TL version info. - my @rel_tl = <REL_TL>; - $::version_string .= $rel_tl[0]; - $::version_string .= $rel_tl[$#rel_tl]; + # print first, which has the TL version info. + my $rel_tl = <REL_TL>; + $::version_string .= $rel_tl; + # for machine readable we only want the last word which is the version + my @foo = split(' ', $rel_tl); + $::mrversion .= "tlversion $foo[$#foo]\n"; close (REL_TL); } + # + # add the list of revisions + if ($::opt_verbosity > 0) { + $::version_string .= "Revisions of TeXLive:: modules:"; + $::version_string .= "\nTLConfig: " . TeXLive::TLConfig->module_revision(); + $::version_string .= "\nTLUtils: " . TeXLive::TLUtils->module_revision(); + $::version_string .= "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision(); + $::version_string .= "\nTLPDB: " . TeXLive::TLPDB->module_revision(); + $::version_string .= "\nTLPaper: " . TeXLive::TLPaper->module_revision(); + $::version_string .= "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision(); + $::version_string .= "\n"; + } + $::mrversion .= "TLConfig " . TeXLive::TLConfig->module_revision(); + $::mrversion .= "\nTLUtils " . TeXLive::TLUtils->module_revision(); + $::mrversion .= "\nTLPOBJ " . TeXLive::TLPOBJ->module_revision(); + $::mrversion .= "\nTLPDB " . TeXLive::TLPDB->module_revision(); + $::mrversion .= "\nTLPaper " . TeXLive::TLPaper->module_revision(); + $::mrversion .= "\nTLWinGoo " . TeXLive::TLWinGoo->module_revision(); + $::mrversion .= "\n"; + } + if ($::machinereadable) { + return $::mrversion; + } else { + return $::version_string; } - # - # add the list of revisions - if ($::opt_verbosity > 0) { - $::version_string .= "Revisions of TeXLive:: modules:"; - $::version_string .= "\nTLConfig: " . TeXLive::TLConfig->module_revision(); - $::version_string .= "\nTLUtils: " . TeXLive::TLUtils->module_revision(); - $::version_string .= "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision(); - $::version_string .= "\nTLPDB: " . TeXLive::TLPDB->module_revision(); - $::version_string .= "\nTLPaper: " . TeXLive::TLPaper->module_revision(); - $::version_string .= "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision(); - $::version_string .= "\n"; - } - return $::version_string; } @@ -6232,7 +6249,7 @@ sub action_shell { } elsif ($cmd eq "help") { print "Please see tlmgr help or http://tug.org/texlive/tlmgr.html.\n"; } elsif ($cmd eq "version") { - print give_version(), "\n"; + print give_version(); } elsif ($cmd =~ m/^(quit|end|bye(bye)?)$/i) { return $F_OK; } elsif ($cmd eq "setup-location") { |