texlive[44571] Master: Hopefully __ is now handled right.

commits+siepo at tug.org commits+siepo at tug.org
Mon Jun 12 15:23:16 CEST 2017


Revision: 44571
          http://tug.org/svn/texlive?view=revision&revision=44571
Author:   siepo
Date:     2017-06-12 15:23:16 +0200 (Mon, 12 Jun 2017)
Log Message:
-----------
Hopefully __ is now handled right.

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/tlpkg/installer/install-menu-text.pl
    trunk/Master/tlpkg/installer/tracked-install.pl

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2017-06-12 00:17:45 UTC (rev 44570)
+++ trunk/Master/install-tl	2017-06-12 13:23:16 UTC (rev 44571)
@@ -202,7 +202,7 @@
 
 # if we find a file installation.profile we ask the user whether we should
 # continue with the installation
-# note, we are in the installer directory.
+# note, we are in the directory from which the aborted installation was run.
 my %profiledata;
 if (-r "installation.profile") {
   my $pwd = Cwd::getcwd();
@@ -563,7 +563,8 @@
     tlwarn("Unknown return value of run_menu: $ret\n");
     exit(3);
   }
-} else {
+} else { # no interactive setting of options
+  *__ = \&::___;
   if (!do_remote_init()) {
     die ("Exiting installation.\n");
   }
@@ -587,7 +588,7 @@
 check_env() unless $ENV{"TEXLIVE_INSTALL_ENV_NOCHECK"};
 create_welcome();
 my $status = 1;
-if ($opt_gui eq 'text' or
+if ($opt_gui eq 'text' or $opt_profile ne "" or
       !(-r "$::installerdir/tlpkg/installer/tracked-install.pl")) {
   $status = do_installation();
   if (@::WARNLINES) {
@@ -596,8 +597,7 @@
   if ($::env_warns) { print STDERR $::env_warns; }
   unless ($ENV{"TEXLIVE_INSTALL_NO_WELCOME"}) {
     foreach my $t (@::welcome_arr) {
-      printf STDOUT sprintf (shift @$t, @$t);
-      print STDOUT "\n";
+      print STDOUT "$t\n";
     }
   }
   do_cleanup(); # sets $::LOGFILENAME if not already defined
@@ -2361,32 +2361,19 @@
 
 

 # Create a welcome message.
-# This is an array of references to anonymous arrays of parameters for
-# either __ or sprintf: a localizable string, possibly with placeholders,
-# followed by parameters for those placeholders, if any.
-#
 sub create_welcome {
   @::welcome_arr = ();
-  push @::welcome_arr, (["\nWelcome to TeX Live!\n"]);
-  push @::welcome_arr, [ <<END_WELCOME_GENERIC,
-Documentation links: %s/index.html
-The TeX Live web site (https://tug.org/texlive/)
-contains updates and corrections.
-
-TeX Live is a joint project of the TeX user groups around the world;
-please consider supporting it by joining the group best for you.
-The list of groups is on the web at https://tug.org/usergroups.html.
-END_WELCOME_GENERIC
-    $::vars{'TEXDIR'}];
+  push @::welcome_arr, "\n";
+  push @::welcome_arr, __("Welcome to TeX Live!");
+  push @::welcome_arr, "\n";
+  push @::welcome_arr, __(
+    "See %s/index.html for links to documentation.\nThe TeX Live web site (http://tug.org/texlive/) contains any updates and corrections. TeX Live is a joint project of the TeX user groups around the world; please consider supporting it by joining the group best for you. The list of groups is available on the web at http://tug.org/usergroups.html.",
+    $::vars{'TEXDIR'});
   if (!win32()) {
-    push @::welcome_arr, [ <<END_WELCOME_W32,
-Add %s/texmf-dist/doc/man to MANPATH.
-Add %s/texmf-dist/doc/info to INFOPATH.
-Most importantly, add %s/bin/%s
-to your PATH for current and future sessions.
-END_WELCOME_W32
-    $::vars{'TEXDIR'}, $::vars{'TEXDIR'}, $::vars{'TEXDIR'},
-    $::vars{'this_platform'}];
+    push @::welcome_arr, __(
+      "Add %s/texmf-dist/doc/man to MANPATH.\nAdd %s/texmf-dist/doc/info to INFOPATH.\nMost importantly, add %s/bin/%s\nto your PATH for current and future sessions.",
+      $::vars{'TEXDIR'}, $::vars{'TEXDIR'}, $::vars{'TEXDIR'},
+      $::vars{'this_platform'});
   }
 }
 
@@ -2426,7 +2413,13 @@
   }
 }
 
-__END__
+# assign \&___ to *__ if __ is not otherwise defined
+sub ___ {
+  my $s = shift;
+  return sprintf($s, @_);
+}
+
+  __END__
 

 =head1 NAME
 

Modified: trunk/Master/tlpkg/installer/install-menu-text.pl
===================================================================
--- trunk/Master/tlpkg/installer/install-menu-text.pl	2017-06-12 00:17:45 UTC (rev 44570)
+++ trunk/Master/tlpkg/installer/install-menu-text.pl	2017-06-12 13:23:16 UTC (rev 44571)
@@ -52,10 +52,8 @@
   return split(//, $string);
 }
 
-sub __ {
-  my $s = shift;
-  return sprintf($s, @_);
-}
+# ___, defined in install-tl, replaces the GUI translating function
+*::__ = \&::___;
 
 sub button { # for main menu: 1 char
   my $val=shift;

Modified: trunk/Master/tlpkg/installer/tracked-install.pl
===================================================================
--- trunk/Master/tlpkg/installer/tracked-install.pl	2017-06-12 00:17:45 UTC (rev 44570)
+++ trunk/Master/tlpkg/installer/tracked-install.pl	2017-06-12 13:23:16 UTC (rev 44571)
@@ -65,8 +65,8 @@
   $::progressw->tagConfigure('centered', -justify => 'center');
   # basic welcome message
   foreach my $t (@::welcome_arr) {
-    my $s = shift @$t;
-    $::progressw->insert("end", __($s, @$t)."\n", 'centered');
+    #my $s = shift @$t;
+    $::progressw->insert("end", "$t\n", 'centered');
   }
   $::progressw->insert("end", "\n");
   # additional info



More information about the tex-live-commits mailing list