texlive[46086] trunk: sync,doc

commits+karl at tug.org commits+karl at tug.org
Mon Dec 18 00:19:23 CET 2017


Revision: 46086
          http://tug.org/svn/texlive?view=revision&revision=46086
Author:   karl
Date:     2017-12-18 00:19:22 +0100 (Mon, 18 Dec 2017)
Log Message:
-----------
sync,doc

Modified Paths:
--------------
    trunk/Build/source/texk/tests/TeXLive/TLConfig.pm
    trunk/Build/source/texk/tests/TeXLive/TLUtils.pm
    trunk/Build/source/texk/texlive/tl_scripts/ChangeLog
    trunk/Build/source/texk/texlive/tl_scripts/texconfig.sh
    trunk/Master/texmf-dist/bibtex/bib/beebe/texbook3.bib
    trunk/Master/tlpkg/doc/releng.txt

Modified: trunk/Build/source/texk/tests/TeXLive/TLConfig.pm
===================================================================
--- trunk/Build/source/texk/tests/TeXLive/TLConfig.pm	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Build/source/texk/tests/TeXLive/TLConfig.pm	2017-12-17 23:19:22 UTC (rev 46086)
@@ -5,7 +5,7 @@
 
 package TeXLive::TLConfig;
 
-my $svnrev = '$Revision: 44018 $';
+my $svnrev = '$Revision: 45617 $';
 my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
 sub module_revision { return $_modulerevision; }
 
@@ -107,6 +107,7 @@
 our $DefaultContainerExtension = "tar.$DefaultContainerFormat";
 
 # archive (not user) settings.
+# these can be overriden by putting them into 00texlive.config.tlpsrc
 our %TLPDBConfigs = (
   "container_split_src_files" => 1,
   "container_split_doc_files" => 1,
@@ -113,6 +114,7 @@
   "container_format" => $DefaultContainerFormat,
   "minrelease" => $MinRelease,
   "release" => $ReleaseYear,
+  "frozen" => 0,
 );
 
 # definition of the option strings and their value types 

Modified: trunk/Build/source/texk/tests/TeXLive/TLUtils.pm
===================================================================
--- trunk/Build/source/texk/tests/TeXLive/TLUtils.pm	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Build/source/texk/tests/TeXLive/TLUtils.pm	2017-12-17 23:19:22 UTC (rev 46086)
@@ -5,7 +5,7 @@
 
 package TeXLive::TLUtils;
 
-my $svnrev = '$Revision: 44872 $';
+my $svnrev = '$Revision: 46045 $';
 my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
 sub module_revision { return $_modulerevision; }
 
@@ -98,7 +98,14 @@
   TeXLive::TLUtils::mktexupd();
   TeXLive::TLUtils::setup_sys_user_mode($optsref,$tmfc, $tmfsc, $tmfv, $tmfsv);
   TeXLive::TLUtils::prepend_own_path();
+  TeXLive::TLUtils::repository_to_array($str);
 
+=head2 JSON
+
+  TeXLive::TLUtils::encode_json($ref);
+  TeXLive::TLUtils::True();
+  TeXLive::TLUtils::False();
+
 =head1 DESCRIPTION
 
 =cut
@@ -112,6 +119,7 @@
   $TeXLive::TLDownload::net_lib_avail
     $::checksum_method $::gui_mode $::machinereadable $::no_execute_actions
     $::regenerate_all_formats
+  $JSON::false $JSON::true
 );
 
 BEGIN {
@@ -185,6 +193,10 @@
     &nulldev
     &get_full_line
     &sort_archs
+    &repository_to_array
+    &encode_json
+    &True
+    &False
   );
   @EXPORT = qw(setup_programs download_file process_logging_options
                tldie tlwarn info log debug ddebug dddebug debug_hash
@@ -1933,7 +1945,7 @@
   # man
   my $top_man_dir = "$Master/texmf-dist/doc/man";
   debug("$mode symlinks for man pages to $sys_man from $top_man_dir\n");
-  if (! -d $top_man_dir && $mode eq "add") {
+  if (! -d $top_man_dir) {
     ; # better to be silent?
     #info("skipping add of man symlinks, no source directory $top_man_dir\n");
   } else {
@@ -3187,7 +3199,7 @@
 sub debug {
   my $str = "D:" . join("", @_);
   return if ($::opt_verbosity < 1);
-  logit(\*STDOUT, 1, $str);
+  logit(\*STDERR, 1, $str);
   for my $i (@::debug_hook) {
     &{$i}($str);
   }
@@ -3209,7 +3221,7 @@
 sub ddebug {
   my $str = "DD:" . join("", @_);
   return if ($::opt_verbosity < 2);
-  logit(\*STDOUT, 2, $str);
+  logit(\*STDERR, 2, $str);
   for my $i (@::ddebug_hook) {
     &{$i}($str);
   }
@@ -3231,7 +3243,7 @@
 sub dddebug {
   my $str = "DDD:" . join("", @_);
   return if ($::opt_verbosity < 3);
-  logit(\*STDOUT, 3, $str);
+  logit(\*STDERR, 3, $str);
   for my $i (@::dddebug_hook) {
     &{$i}($str);
   }
@@ -4128,8 +4140,207 @@
 }
 
 
+sub repository_to_array {
+  my $r = shift;
+  my %r;
+  my @repos = split ' ', $r;
+  if ($#repos == 0) {
+    # only one repo, this is the main one!
+    $r{'main'} = $repos[0];
+    return %r;
+  }
+  for my $rr (@repos) {
+    my $tag;
+    my $url;
+    # decode spaces and % in reverse order
+    $rr =~ s/%20/ /g;
+    $rr =~ s/%25/%/g;
+    $tag = $url = $rr;
+    if ($rr =~ m/^([^#]+)#(.*)$/) {
+      $tag = $2;
+      $url = $1;
+    }
+    $r{$tag} = $url;
+  }
+  return %r;
+}
+
+=item C<encode_json($ref)>
+
+Returns the JSON representation of the object C<$ref> is pointing at.
+This tries to load the C<JSON> Perl module, and uses it if available,
+otherwise falls back to module internal conversion.
+
+The used backend can be selected by setting the environment variable
+C<TL_JSONMODE> to either C<json> or C<texlive> (all other values are
+ignored). If C<json> is requested and the C<JSON> module cannot be loaded
+the program terminates.
+
+=cut
+
+my $TLTrueValue = 1;
+my $TLFalseValue = 0;
+my $TLTrue = \$TLTrueValue;
+my $TLFalse = \$TLFalseValue;
+bless $TLTrue, 'TLBOOLEAN';
+bless $TLFalse, 'TLBOOLEAN';
+
+our $jsonmode = "";
+
+=item C<True()>
+=item C<False()>
+
+these two function must be used to get proper JSON C<true> and C<false> 
+in the output independent of the backend used.
+
+=cut
+
+sub True {
+  ensure_json_available();
+  if ($jsonmode eq "json") {
+    return($JSON::true);
+  } else {
+    return($TLTrue);
+  }
+}
+sub False {
+  ensure_json_available();
+  if ($jsonmode eq "json") {
+    return($JSON::false);
+  } else {
+    return($TLFalse);
+  }
+}
+
+sub ensure_json_available {
+  return if ($jsonmode);
+  # check the environment for mode to use:
+  # $ENV{'TL_JSONMODE'} = texlive | json
+  my $envdefined = 0;
+  if ($ENV{'TL_JSONMODE'}) {
+    $envdefined = 1;
+    if ($ENV{'TL_JSONMODE'} eq "texlive") {
+      $jsonmode = "texlive";
+      debug("texlive json module used!\n");
+      return;
+    } elsif ($ENV{'TL_JSONMODE'} eq "json") {
+      # nothing to do
+    } else {
+      tlwarn("Unsupported mode \'$ENV{TL_JSONMODE}\' set in TL_JSONMODE, ignoring it!");
+      $envdefined = 0;
+    }
+  }
+  return if ($jsonmode); # was set to texlive
+  eval { require JSON; };
+  if ($@) {
+    # that didn't work out, use home-grown json
+    if ($envdefined) {
+      # environment asks for JSON but cannot be loaded, die!
+      tldie("env variable TL_JSONMODE request JSON module but cannot be load!\n");
+    }
+    $jsonmode = "texlive";
+    debug("texlive json module used!\n");
+  } else {
+    $jsonmode = "json";
+    my $json = JSON->new;
+    debug("JSON " . $json->backend . " used!\n");
+  }
+}
+
+sub encode_json {
+  my $val = shift;
+  ensure_json_available();
+  if ($jsonmode eq "json") {
+    my $utf8_encoded_json_text = JSON::encode_json($val);
+    return $utf8_encoded_json_text;
+  } else {
+    my $type = ref($val);
+    if ($type eq "") {
+      tldie("encode_json: accept only refs: $val");
+    } elsif ($type eq 'SCALAR') {
+      return(scalar_to_json($$val));
+    } elsif ($type eq 'ARRAY') {
+      return(array_to_json($val));
+    } elsif ($type eq 'HASH') {
+      return(hash_to_json($val));
+    } elsif ($type eq 'REF') {
+      return(encode_json($$val));
+    } elsif (Scalar::Util::blessed($val)) {
+      if ($type eq "TLBOOLEAN") {
+        return($$val ? "true" : "false");
+      } else {
+        tldie("encode_json: unsupported blessed object");
+      }
+    } else {
+      tldie("encode_json: unsupported format $type");
+    }
+  }
+}
+
+sub scalar_to_json {
+  sub looks_like_numeric {
+    # code from JSON/backportPP.pm
+    my $value = shift;
+    no warnings 'numeric';
+    # detect numbers
+    # string & "" -> ""
+    # number & "" -> 0 (with warning)
+    # nan and inf can detect as numbers, so check with * 0
+    return unless length((my $dummy = "") & $value);
+    return unless 0 + $value eq $value;
+    return 1 if $value * 0 == 0;
+    return -1; # inf/nan
+  }
+  my $val = shift;
+  if (defined($val)) {
+    if (looks_like_numeric($val)) {
+      return("$val");
+    } else {
+      return(string_to_json($val));
+    }
+  } else {
+    return("null");
+  }
+}
+
+sub string_to_json {
+  my $val = shift;
+  my %esc = (
+    "\n" => '\n',
+    "\r" => '\r',
+    "\t" => '\t',
+    "\f" => '\f',
+    "\b" => '\b',
+    "\"" => '\"',
+    "\\" => '\\\\',
+    "\'" => '\\\'',
+  );
+  $val =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g;
+  return("\"$val\"");
+}
+
+sub hash_to_json {
+  my $hr = shift;
+  my @retvals;
+  for my $k (keys(%$hr)) {
+    my $val = $hr->{$k};
+    push @retvals, "\"$k\":" . encode_json(\$val);
+  }
+  my $ret = "{" . join(",", @retvals) . "}";
+  return($ret);
+}
+
+sub array_to_json {
+  my $hr = shift;
+  my $ret = "[" . join(",", map { encode_json(\$_) } @$hr) . "]";
+  return($ret);
+}
+
+
+
 =back
 =cut
+
 1;
 __END__
 

Modified: trunk/Build/source/texk/texlive/tl_scripts/ChangeLog
===================================================================
--- trunk/Build/source/texk/texlive/tl_scripts/ChangeLog	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Build/source/texk/texlive/tl_scripts/ChangeLog	2017-12-17 23:19:22 UTC (rev 46086)
@@ -1,3 +1,7 @@
+2017-12-18  Karl Berry  <karl at tug.org>
+
+	* texconfig.sh: more updates from Norbert to use tlmgr (from 45882).
+
 2017-04-24  Paul Vojta  <vojta at math.berkeley.edu>
 
 	* texconfig.sh: xdvi paper size updates (also in TLPaper.pm).

Modified: trunk/Build/source/texk/texlive/tl_scripts/texconfig.sh
===================================================================
--- trunk/Build/source/texk/texlive/tl_scripts/texconfig.sh	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Build/source/texk/texlive/tl_scripts/texconfig.sh	2017-12-17 23:19:22 UTC (rev 46086)
@@ -188,6 +188,18 @@
 }
 
 ###############################################################################
+# setupTexmfroot() - get value for MT_TEXMFROOT (with caching)
+#
+setupTexmfroot()
+{
+  case $MT_TEXMFROOT in
+    "") MT_TEXMFROOT=`kpsewhich -var-value=TEXMFROOT`;;
+    *) return;;
+  esac
+}
+
+
+###############################################################################
 # setupTexmfmain() - get value for MT_TEXMFMAIN (with caching)
 #
 setupTexmfmain()
@@ -537,8 +549,9 @@
 showDistVersionInfo()
 {
   # TeX Live file.
-  test -f $MT_TEXMFMAIN/../release-texlive.txt \
-  && sed 1q $MT_TEXMFMAIN/../release-texlive.txt
+  setupTexmfroot
+  test -f $MT_TEXMFROOT/release-texlive.txt \
+  && sed 1q $MT_TEXMFROOT/release-texlive.txt
 
   # no harm in continuing to look for the teTeX files.
   test -f $MT_TEXMFMAIN/release-tetex-src.txt \
@@ -560,7 +573,7 @@
 Usage: $progname conf                  (show configuration information)
        $progname dvipdfmx paper PAPER  (dvipdfmx paper size)
        $progname dvips [OPTION...]     (dvips options)
-       $progname faq                   (show teTeX faq)
+       $progname faq                   (show pointer to TeX Live docs)
        $progname findprog PROG...      (show locations of PROGs, a la which)
        $progname font vardir DIR
        $progname font ro
@@ -633,7 +646,9 @@
         paper)
           case $3 in
             letter|legal|ledger|tabloid|a4|a3)
-              fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
+              tlmgr dvipdfmx paper $3
+              ;;
+              # fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
             "") echo "$help" >&2; rc=1;;
             *)
              echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2
@@ -781,7 +796,8 @@
                   ;;
                 *)
                   if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then
-                    setupDvipsPaper "$tcBatchDvipsPaper"
+                    tlmgr dvips paper $tcBatchDvipsPaper
+                    # setupDvipsPaper "$tcBatchDvipsPaper"
                   else
                     echo "$progname: paper \`$tcBatchDvipsPaper' not found in file \`$configPsFile'" >&2; rc=1
                   fi
@@ -857,14 +873,17 @@
       ;;
 
     faq)
-      setupTexmfmain
-      if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then
-        <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more}
-      else
-        echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2
-        rc=1
-      fi
+      echo "Please see https://tug.org/texlive/doc/ for the documentation"
+      echo "available in TeX Live."
       ;;
+      # setupTexmfmain
+      # if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then
+      #   <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more}
+      # else
+      #   echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2
+      #   rc=1
+      # fi
+      # ;;
 
     findprog)
       shift
@@ -873,6 +892,7 @@
 
     # handle "texconfig font"
     font)
+      setupTexmfroot
       help="Usage: $progname font vardir DIR
        $progname font ro
        $progname font rw
@@ -899,7 +919,9 @@
               ;;
             *)
               tcBatchFontVardir=$3
-              tfc=`kpsewhich texmf.cnf`
+              # tfc=`kpsewhich texmf.cnf`
+              tfc="$MT_TEXMFROOT/texmf.cnf"
+              touch "$tfc"
               if test -n "$tfc"; then
                 if test -w "$tfc"; then
                   configReplace "$tfc" '^VARTEXFONTS' "VARTEXFONTS  = $tcBatchFontVardir"
@@ -1240,25 +1262,28 @@
 
         paper)
           case $3 in
-            letter)
-              w="8.5 true in"; h="11 true in"
-              setupTmpDir
-              fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
-              wChanged=$fmgrConfigReplaceChanged
-              fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
-              if $wChanged || $fmgrConfigReplaceChanged; then
-                fmtutil --refresh
-              fi
+            letter|a4)
+              tlmgr pdftex paper $3
               ;;
-            a4)
-              w="210 true mm"; h="297 true mm"
-              fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
-              wChanged=$fmgrConfigReplaceChanged
-              fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
-              if $wChanged || $fmgrConfigReplaceChanged; then
-                fmtutil --refresh
-              fi
-              ;;
+            #letter)
+            #  w="8.5 true in"; h="11 true in"
+            #  setupTmpDir
+            #  fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
+            #  wChanged=$fmgrConfigReplaceChanged
+            #  fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
+            #  if $wChanged || $fmgrConfigReplaceChanged; then
+            #    fmtutil --refresh
+            #  fi
+            #  ;;
+            #a4)
+            #  w="210 true mm"; h="297 true mm"
+            #  fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
+            #  wChanged=$fmgrConfigReplaceChanged
+            #  fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
+            #  if $wChanged || $fmgrConfigReplaceChanged; then
+            #    fmtutil --refresh
+            #  fi
+            #  ;;
             "") echo "$help" >&2; rc=1;;
             *)
              echo "$progname: unknown PAPER \`$3' given as argument for \`$progname pdftex paper'" >&2
@@ -1378,7 +1403,8 @@
         paper)
           case $3 in
             [abc][0-9]|[abc]10|[abc][0-9]r|[abc]10r|us|letter|ledger|tabloid|usr|legal|legalr|foolscap|foolscapr)
-              fmgrConfigReplace XDvi paper: "*paper: $3"
+              tlmgr xdvi paper $3
+              # fmgrConfigReplace XDvi paper: "*paper: $3"
               ;;
             "") echo "$help" >&2; rc=1;;
             *)

Modified: trunk/Master/texmf-dist/bibtex/bib/beebe/texbook3.bib
===================================================================
--- trunk/Master/texmf-dist/bibtex/bib/beebe/texbook3.bib	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Master/texmf-dist/bibtex/bib/beebe/texbook3.bib	2017-12-17 23:19:22 UTC (rev 46086)
@@ -17,7 +17,7 @@
 %%%     telephone       = "+1 801 581 5254",
 %%%     FAX             = "+1 801 581 4148",
 %%%     URL             = "http://www.math.utah.edu/~beebe",
-%%%     checksum        = "46857 17301 71011 697160",
+%%%     checksum        = "15640 17301 71011 697158",
 %%%     email           = "beebe at math.utah.edu, beebe at acm.org,
 %%%                        beebe at computer.org (Internet)",
 %%%     codetable       = "ISO/ASCII",
@@ -16210,7 +16210,7 @@
   address =      pub-SV:adr,
   pages =        "xxv + 296",
   year =         "2017",
-  DOI =          "http://dx.doi.org/10.1007/978-3-319-47831-9",
+  DOI =          "https://doi.org/10.1007/978-3-319-47831-9",
   ISBN =         "3-319-47830-3, 3-319-47831-1 (e-book),",
   ISBN-13 =      "978-3-319-47830-2, 978-3-319-47831-9 (e-book),",
   LCCN =         "T11 .D388 2017; Z52.4",

Modified: trunk/Master/tlpkg/doc/releng.txt
===================================================================
--- trunk/Master/tlpkg/doc/releng.txt	2017-12-17 23:16:51 UTC (rev 46085)
+++ trunk/Master/tlpkg/doc/releng.txt	2017-12-17 23:19:22 UTC (rev 46086)
@@ -141,6 +141,7 @@
     tl-update-man
     # then run make in texmf-dist/doc/man
     # and check /tmp/so.rules against man1/Makefile
+  Update texdoc Data.tlpdb.lua.
 
 N. Really test during pretest (really! don't leave it for knuth!):
   .fmt's sharable across endian-different platforms (including luatex).



More information about the tex-live-commits mailing list