texlive[51286] Master/texmf-dist: bxwareki (1jun19)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 1 22:57:31 CEST 2019


Revision: 51286
          http://tug.org/svn/texlive?view=revision&revision=51286
Author:   karl
Date:     2019-06-01 22:57:31 +0200 (Sat, 01 Jun 2019)
Log Message:
-----------
bxwareki (1jun19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bxwareki/README.md
    trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.pdf
    trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.tex
    trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki-cd.def
    trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki.sty

Modified: trunk/Master/texmf-dist/doc/latex/bxwareki/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxwareki/README.md	2019-06-01 16:01:23 UTC (rev 51285)
+++ trunk/Master/texmf-dist/doc/latex/bxwareki/README.md	2019-06-01 20:57:31 UTC (rev 51286)
@@ -36,6 +36,8 @@
 Revision History
 ----------------
 
+  * Version 0.6  ‹2019/06/01›
+      - The file `bxwareki2019.def` is no longer required.
   * Version 0.5  ‹2019/04/01›
       - Support for the new gengo “令和”.
   * Version 0.4  ‹2018/10/01›

Modified: trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.tex	2019-06-01 16:01:23 UTC (rev 51285)
+++ trunk/Master/texmf-dist/doc/latex/bxwareki/bxwareki.tex	2019-06-01 20:57:31 UTC (rev 51286)
@@ -3,8 +3,8 @@
 \usepackage[scale=0.75]{geometry}
 \usepackage{shortvrb}
 \MakeShortVerb{\|}
-\newcommand{\PkgVersion}{0.5}
-\newcommand{\PkgDate}{2019/04/01}
+\newcommand{\PkgVersion}{0.6}
+\newcommand{\PkgDate}{2019/06/01}
 \newcommand{\Pkg}[1]{\textsf{#1}}
 \newcommand{\Meta}[1]{$\langle$\textit{#1}$\rangle$}
 \newcommand{\Note}{\par\noindent\emph{Note:}\quad}
@@ -34,6 +34,8 @@
 (\Ja{平成\+30\+年\+8\+月\+28\+日}).
 You can choose whether the numbers are written
 in Western numerals (28) or kanji numerals (\Ja{二八}).
+The package is aware of the current era name,
+\emph{Reiwa}~(\Ja{令和}).
 
 Note that the package only deals with dates in the year 1873 or later,
 where the Japanese calendar is really a Gregorian calendar
@@ -58,9 +60,7 @@
 \section{Package Loading}
 \label{sec:Loading}
 
-No options are needed in normal use%
-\footnote{See Section~\ref{ssec:download2019}
-  for the \texttt{download2019} option.}.
+No options are available.
 
 \begin{quote}\small\begin{verbatim}
 \usepackage{bxwareki}
@@ -210,53 +210,6 @@
 \end{itemize}
 
 %===========================================================
-\section{Support for the kaigen planned in 2019}
-\label{sec:Kaigen}
-
-In Japan a kaigen (due to the abdication of the Emperor)
-is planned on 2019/05/01,
-and the new gengo ``\Ja{令和}'' has been announced in advance.
-(The announcement was made on 2019/04/01.)
-Thus this package has been updated to support the new gengo.
-
-%-------------------
-\subsection{The \texttt{download2019} option}
-\label{ssec:download2019}
-
-\begin{quote}\itshape
-This function is no longer necessary,
-since the new gengo is supported by default in the current version.
-The function will be removed in near future.
-\end{quote}
-
-Instead of manually downloading the new version from CTAN,
-you can get the support for the new gengo
-with a single run of {\LaTeX}
-(of course after the annoucement of the gengo):
-when you compile a document which loads this package
-with |download2019| option using {\LuaLaTeX}
-with \emph{full shell escape} enabled%
-\footnote{In most system, full shell escape is enabled
-  by \texttt{-shell-escape} option.},
-then the run will download an additional file
-from the package's GitHub repository
-and install it into the user's TEXMF tree.
-
-In short: make the following dummy%
-\footnote{Using the dummy document with minimal content
-could reduce the risk of using full shell escape,
-but you need to trust me, of course.}
-document file (named |dummy.tex|)
-\begin{quote}\small\begin{verbatim}
-\documentclass{article}
-\usepackage[download2019]{bxwareki}
-\stop
-\end{verbatim}\end{quote}
-and run |lualatex -shell-escape dummy|.
-After that, the new gengo will be supported
-on any engine, without shell escape.
-
-%===========================================================
 \section{Notices for {\TeX} programmers}
 \label{sec:Allez}
 

Modified: trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki-cd.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki-cd.def	2019-06-01 16:01:23 UTC (rev 51285)
+++ trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki-cd.def	2019-06-01 20:57:31 UTC (rev 51286)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'bxwareki-cd.def'.
 %%
-%% Copyright (c) 2018 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2018,2019 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -12,18 +12,12 @@
 
 %% file declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{bxwareki-cd.def}[2018/10/01 v0.4]
+\ProvidesFile{bxwareki-cd.def}[2019/06/01 v0.6]
 
 \ifbxwy at epTeXinputencoding@ok
   \epTeXinputencoding utf8
 \fi
 
-%% branch for download mode
-\ifbxwy at download
-  \long\def\bxwy at next#1\bxwy at download{}
-  \expandafter\bxwy at next
-\fi
-
 %--------------------------------------- helpers
 
 %% \bxwy at burst-`>...
@@ -127,283 +121,6 @@
 \def\bxwy at cdpo@@o#1#2#3{#1#2o}
 \def\bxwy at cdpo@@O#1#2#3{#1#2O}
 
-%--------------------------------------- special procedure for LuaTeX
-\ifx\bxwy at new@gengo\@empty \ifnum\bxwy at engine=5
-
-% The process below tries to guess the name of the new gengo
-% from the result of os,date().
-\begingroup
-  \catcode`\~=12 \let\0\relax \let\1\relax \let\2\relax
-  \directlua{
-    if not bxwareki then bxwareki = {} end
-    local os = bxwareki.os or os
-    function bxwareki.get_new_gengo()
-      local lc_time = nil
-      local ok, ret = pcall(function()
-        assert(os.type == "unix")
-        lc_time = os.setlocale(nil, "time")
-        assert(os.setlocale("ja_JP.utf8", "time") or
-          os.setlocale("ja_JP.UTF-8", "time"))
-        local heisei = "\229\185\179\230\136\144"
-        local kanji = "[\228-\233][\128-\191][\128-\191]"
-        local gh = os.date("\037EC", 1500000000)
-        local gn = os.date("\037EC", 1600000000)
-        assert(gh == heisei and gn ~= heisei and
-          gn:match("^"..kanji..kanji.."$"))
-        return gn
-      end)
-      os.setlocale(lc_time, "time")
-      return ok and ret or ""
-    end}
-  \toks@{}
-  \directlua{pcall(function()
-    tex.toks[0] = bxwareki.get_new_gengo()
-  end)}
-  \xdef\bxwy at new@gengo{\the\toks@}
-\endgroup
-
-\fi\fi
 %--------------------------------------- all done
 \endinput
-%=======================================
-\bxwy at download
-\begingroup
-\catcode`\^^A=14 \catcode`\^^\=0 \catcode`\^^[=1 \catcode`\^^]=2
-\endlinechar=10 \catcode10=12 \catcode96=7 \let\do\@makeother
-\dospecials``\directlua``[``A
-local ok, retcode = pcall(function()
----------------------------------------- shell availability check
-local ok = false
-if ((status and status.luatex_version) or 0) >= 68 then
-  ok = (os.execute() == 1)
-end
-if not ok then return 2 end
----------------------------------------- preparations
-local url = 'https://raw.githubusercontent.com/zr-tex8r/BXwareki/master/bxwareki2019.def'
-local fdef = 'bxwareki2019.def'
-io.stderr:write("\n\n//////// START BXWAREKI DOWNLOAD PROCEDURE ////////\n")
-local function log(s)
-  io.stderr:write("bxwareki: ", s, "\n")
-end
-local function info(f, ...) log(f:format(...)) end
-local function finish(s, ...) info(...); return s end
----------------------------------------- 'zrget' module
-zrget = (function(M)
-  -- parameters
-  M.max_trial = M.max_trial  or 3
-  M.interval  = M.interval   or 1 -- second
-  M.log       = M.log        or true
-
-  -- helpers
-  local lfs = require 'lfs'
-  local socket = require 'socket'
-  local tempb = '__zrget'
-  local win = (lfs.attributes('C:\\NUL', 'mode') ~= nil)
-  local function upath(pth)
-    return (win) and pth:gsub('\\', '/') or pth
-  end
-  local function npath(pth)
-    return (win) and pth:gsub('/', '\\') or pth
-  end
-  local function mpath(...)
-    return table.concat({...}, (win) and '\\' or '/')
-  end
-  local function log_print(s)
-    io.stderr:write("zrget: ", s, "\n")
-  end
-  local function log(fmt, ...)
-    if not M.log then return end
-    local l = (type(M.log) == 'function') and M.log or log_print
-    l(tostring(fmt):format(...))
-  end
-  local function file_ok(pth)
-    return ((lfs.attributes(pth, 'size') or 0) > 0)
-  end
-  local function execute(clfmt, ...)
-    local cl = clfmt:format(...)
-    if M.verbose then log("RUN: %s", cl) end
-    local ok = os.execute(cl)
-    return (ok == true) or (ok == 0)
-  end
-  local badbin = '*'
-  local function exefile(pth)
-    pth = npath(pth..(win and '.exe' or ''))
-    return (file_ok(pth) or nil) and pth
-  end
-  local function validate(vprc, pth)
-    if not file_ok(pth) then return false end
-    local h = io.open(pth, 'rb')
-    local d = h and h:read('*a')
-    if h then h:close() end
-    local r = d and (not vprc or vprc(d))
-    if not r then log("Validation failure") end
-    return r
-  end
-
-  -- TeXLive stuffs
-  local kpse
-  pcall(function()
-    kpse = require 'kpse'
-    kpse.set_program_name('luatex')
-  end)
-  local tlpkg = kpse and kpse.var_value('SELFAUTOPARENT')
-  tlpkg = tlpkg and tlpkg..'/tlpkg'
-  local tlwget = tlpkg and exefile(tlpkg..'/installer/wget/wget')
-  local tlperl = tlpkg and exefile(tlpkg..'/tlperl/bin/perl')
-
-  -- methods
-  local fcout, fcerr, ftdst =
-      tempb..'-1.out', tempb..'-2.out', tempb..'-0.bin'
-  local method_list = {
-    {
-      name = 'wget';
-      checker = 'wget --version'; check_tag = 'Wget';
-      loader = function(src)
-        return execute('wget -q --no-check-certificate "%s" -O %s 2>%s',
-            src, ftdst, fcerr)
-      end
-    },
-    {
-      name = 'curl';
-      checker = 'curl --version'; check_tag = 'curl';
-      loader = function(src)
-        return execute('curl -k -s "%s" -o %s 2>%s',
-            src, ftdst, fcerr)
-      end
-    },
-    {
-      name = 'tl-wget';
-      checker = tlwget and tlwget..' --version'; check_tag = 'Wget';
-      loader = function(src)
-        return execute('%s -q --no-check-certificate "%s" -O %s 2>%s',
-            tlwget, src, ftdst, fcerr)
-      end
-    },
-    {
-      name = 'powershell';
-      checker = 'powershell -Help'; check_tag = 'PowerShell';
-      loader = function(src)
-        return execute('powershell -Command Invoke-WebRequest '..
-            '"%s" -OutFile %s 2>%s',
-            src, ftdst, fcerr)
-      end
-    },
---[[
-    {
-      name = 'tl-perl';
-      checker = tlperl and tlperl..' --version'; check_tag = '?Perl';
-      loader = function(src)
-        return false -- TODO: make it
-      end
-    },
-]]
-  }
-
-  -- main procedure
-  function M.download(url, dst, vprc)
-    url = tostring(url):gsub('[\1-\31 \"\'<>\\`{|}]',
-      function(s) return ('%%%02X'):format(string.byte(s)) end)
-    if file_ok(dst) then
-      log("File '%s' already exists", dst)
-      return false
-    end
-    os.remove(dst)
-    --
-    local done = false
-    for tc = 1, M.max_trial do
-      for _, mth in ipairs(method_list) do
-        repeat
-          if not mth.checker or mth.pass then break end
-          log("Try method '%s'...(%s)", mth.name, tc)
-          -- check
-          execute('%s 1>%s 2>%s', mth.checker, fcout, fcerr)
-          local hso = io.open(fcout, 'rb')
-          local p = (hso and hso:read('*a') or ''):find(mth.check_tag, 1, true)
-          hso:close()
-          if not p then
-            log("Method '%s' is not available", mth.name)
-            mth.pass = true
-            break
-          end
-          -- download
-          log("Try downloading...")
-          os.remove(ftdst)
-          if mth.loader(url) and validate(vprc, ftdst) then
-            done = true; break
-          end
-          socket.sleep(M.interval)
-          os.remove(ftdst)
-        until true
-        if done then break end
-      end
-      if done then break end
-    end
-    --
-    if done then
-      os.rename(ftdst, dst)
-      log("File '%s' is successfully downloaded", dst)
-    else
-      log("File '%s' cannot be downloaded", dst)
-    end
-    --
-    for _, f in ipairs {ftdst, fcerr, fcout} do
-      os.remove(f)
-    end
-    return done
-  end
-
-  return M
-end)({})
----------------------------------------- make directory
-if kpse.find_file(fdef, 'tex', true) then
-  return finish(0, "File '%s' already exists.", fdef)
-end
-local phome = kpse.var_value("TEXMFHOME")
-if not (phome and lfs.isdir(phome)) then
-  return finish(1, "TEXMFHOME is invalid.")
-end
-local ppkg = assert(kpse.find_file('bxwareki.sty', 'tex', true))
-local pm = (ppkg:match('^.*(tex/latex.*)') or 'tex/latex/bxwareki/')
-    :gsub('/[^/]*$', '')
-local pddir = phome
-for t in pm:gmatch('[^/]+') do
-  pddir = pddir..'/'..t
-  lfs.mkdir(pddir)
-end
-if not lfs.isdir(pddir) then
-  return finish(1, "Cannot create directory '%s'", pddir)
-end
----------------------------------------- download
-zrget.log = log
-info("Target file is '%s'.", fdef)
-local ok = zrget.download(url, fdef,
-  function (d) return d:match('^%x%x%x%x%x%x:%x%x%x%x:') end)
-if not ok then return 1 end
----------------------------------------- transfer
-local pddef = pddir..'/'..fdef
-local hddef = io.open(pddef, 'wb')
-if not hddef then
-  return finish(1, 'Cannot open '%s' for output.', pddef)
-end
-local hsdef = assert(io.open(fdef, 'rb'))
-assert(hddef:write(assert(hsdef:read('*a'))))
-hsdef:close(); hddef:close()
-os.remove(fdef)
-info("Target file is copied to '%s'.", pddef)
----------------------------------------- last check
-if not kpse.find_file(fdef, 'tex', true) then
-  return finish(1, "Target file is still not found.")
-end
-return finish(0, "Target file is installed at '%s'.", pddef)
----------------------------------------- done
-end)
-if not ok then
-  io.stderr:write("\n\nINTERNAL ERROR:\n"..tostring(retcode).."\n")
-  retcode = 1
-end
-tex.setcount('global', 'count@', retcode)
-``]``\endgroup%
-
-\chardef\bxwy at next=\count@
-
 %% EOF

Modified: trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki.sty	2019-06-01 16:01:23 UTC (rev 51285)
+++ trunk/Master/texmf-dist/tex/latex/bxwareki/bxwareki.sty	2019-06-01 20:57:31 UTC (rev 51286)
@@ -12,7 +12,7 @@
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxwareki}[2019/04/01 v0.5]
+\ProvidesPackage{bxwareki}[2019/06/01 v0.6]
 
 %% preparation
 \def\bxwy at pkgname{bxwareki}
@@ -89,36 +89,11 @@
 
 %--------------------------------------- options
 
-%% variables
-\newif\ifbxwy at download
-
 %% 'download'
-\DeclareOption{download2019}{%
-  \bxwy at downloadtrue}
+\DeclareOption{download2019}{}% now no-op
 % dispatch
 \ProcessOptions\relax
 
-%--------------------------------------- download mode
-
-\ifbxwy at download
-  \chardef\bxwy at next=\tw@
-  \ifnum\bxwy at engine=5
-    \input{bxwareki-cd.def}
-  \fi
-  \ifcase\bxwy at next
-    \PackageInfo\bxwy at pkgname
-     {The installation of 'bxwareki2019.def' succeeded\@gobble}
-  \or
-    \PackageWarningNoLine\bxwy at pkgname
-     {The installation of 'bxwareki2019.def' failed}
-  \else
-    \PackageWarningNoLine\bxwy at pkgname
-     {Download mode is not available here and thus\MessageBreak
-      the option 'download2019' is ignored}
-  \fi
-\fi
-\bxwy at downloadfalse
-
 %--------------------------------------- Japanese string maker
 
 % The "combo-code" represents a single Japanese character and has
@@ -226,6 +201,10 @@
 \let\bxwy@@heisei\@empty
 \bxwy at add@jchar\bxwy@@heisei{E5B9B3:5E73:4A3F:jAA}
 \bxwy at add@jchar\bxwy@@heisei{E68890:6210:402E:fED}
+%% \bxwy@@reiwa : kanji string 'Reiwa'
+\let\bxwy@@reiwa\@empty
+\bxwy at add@jchar\bxwy@@reiwa{E4BBA4:4EE4:4E61:l44}
+\bxwy at add@jchar\bxwy@@reiwa{E5928C:548C:4F42:l83}
 %% \bxwy@@nen : kanji for 'year'
 \let\bxwy@@nen\@empty
 \bxwy at add@jchar\bxwy@@nen{E5B9B4:5E74:472F:i80}
@@ -304,48 +283,6 @@
   \ifnum#2>\z@  \bxwy at twicex{\csname bxwy at jcd/X\endcsname}\fi
   \ifnum#3>\z@  \bxwy at twicex{\csname bxwy at jcd/#3\endcsname}\fi}
 
-%--------------------------------------- load the new gengo
-
-%% \bxwy at new@gengo at file
-% The external data file for the new gengo.
-\def\bxwy at new@gengo at file{bxwareki2019.def}
-
-%% \bxwy at new@gengo
-% The kanji string for the new gengo if available; otherwise empty.
-\let\bxwy at new@gengo\@empty
-
-%% \bxwy at new@gengo at initial
-% The initial Latin letter for the new gengo.
-\let\bxwy at new@gengo at initial\@empty
-
-%% read the file
-\endlinechar\m at ne
-\openin\@inputcheck=\bxwy at new@gengo at file\relax
-\ifeof\@inputcheck\else % if available
-  \read\@inputcheck to\bxwy at tmpa
-  \ifeof\@inputcheck\else
-    \edef\bxwy at next{\noexpand\bxwy at new@gengo{\bxwy at tmpa}}
-    \expandafter\bxwy at add@jchar\bxwy at next
-    \read\@inputcheck to\bxwy at tmpa
-    \ifeof\@inputcheck
-      \global\let\bxwy at new@gengo\@empty
-    \else
-      \edef\bxwy at next{\noexpand\bxwy at new@gengo{\bxwy at tmpa}}
-      \expandafter\bxwy at add@jchar\bxwy at next
-      \read\@inputcheck to\bxwy at tmpa
-      \ifeof\@inputcheck
-        \global\let\bxwy at new@gengo\@empty
-      \else
-        \let\bxwy at new@gengo at initial\bxwy at tmpa
-      \fi
-    \fi
-  \fi
-\fi
-\endlinechar=13 %
-\def\bxwy at next#1>#2#3#4\bxwy at end{%
-  \ifx#3\relax\else \let\bxwy at new@gengo at initial\@empty \fi}
-\expandafter\bxwy at next\meaning\bxwy at new@gengo at initial\relax\relax\bxwy at end
-
 %--------------------------------------- calculate wareki year
 
 %% errors
@@ -401,10 +338,8 @@
     \let\bxwy at tmpb\bxwy@@heisei
     \advance\@tempcntb-1988\relax
   \else % the new era
-    \ifx\bxwy at new@gengo\@empty\else
-      \let\bxwy at tmpb\bxwy at new@gengo
-      \advance\@tempcntb-2018\relax
-    \fi
+    \let\bxwy at tmpb\bxwy@@reiwa
+    \advance\@tempcntb-2018\relax
   \fi\fi\fi\fi\fi
   %
   \global\let\bxwy at g@gengo\bxwy at tmpb
@@ -418,7 +353,7 @@
   \else\ifx#1\bxwy@@taisho T%
   \else\ifx#1\bxwy@@showa  S%
   \else\ifx#1\bxwy@@heisei H%
-  \else\ifx#1\bxwy at new@gengo \bxwy at new@gengo at initial
+  \else\ifx#1\bxwy@@reiwa  R%
   \fi\fi\fi\fi\fi\fi}
 
 %--------------------------------------- render wareki date



More information about the tex-live-commits mailing list