texlive[49169] trunk: pdftex-quiet (15nov18)

commits+karl at tug.org commits+karl at tug.org
Thu Nov 15 23:21:51 CET 2018


Revision: 49169
          http://tug.org/svn/texlive?view=revision&revision=49169
Author:   karl
Date:     2018-11-15 23:21:51 +0100 (Thu, 15 Nov 2018)
Log Message:
-----------
pdftex-quiet (15nov18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/pdftex-quiet/pdftex-quiet
    trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl
    trunk/Master/texmf-dist/doc/support/pdftex-quiet/LICENCE
    trunk/Master/texmf-dist/doc/support/pdftex-quiet/README.md
    trunk/Master/texmf-dist/doc/support/pdftex-quiet/VERSION
    trunk/Master/texmf-dist/scripts/pdftex-quiet/pdftex-quiet

Modified: trunk/Build/source/texk/texlive/linked_scripts/pdftex-quiet/pdftex-quiet
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/pdftex-quiet/pdftex-quiet	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Build/source/texk/texlive/linked_scripts/pdftex-quiet/pdftex-quiet	2018-11-15 22:21:51 UTC (rev 49169)
@@ -1,36 +1,81 @@
 #!/bin/bash
 #
-# Author: Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
-# Licence: GNU GPLv3
-# Version: v1.0.0
+# pdftex-quiet
+# Copyright (C) 2018  Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
 #
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Print help if required
-if [[ "$@" =~ -help ]]; then
-	echo "Usage: pdftex-quiet [OPTION]... TEXNAME[.tex]"
-	echo
+VERSION="v1.1.0"
 
-	# Print only arguments from the pdftex help
-	pdftex --help | grep --color=never -E '^[\[-]' -A500
-	exit $?
-fi
-
 # Do not ignore failures within the pipe
 set -o pipefail
 
-# FILENAME is always the last argument for pdftex
+# Get the script name
+BASENAME=`basename "$0"`
+
+# Remove the script's name '-quiet' suffix to get the underlying program to wrap
+WRAPPED_PROGRAM=${BASENAME/%-quiet}
+
+# Assert the wrapped program is either pdflatex or pdftex
+[[ "$WRAPPED_PROGRAM" =~ ^pdf(la)?tex$ ]] || {
+	echo "ERROR: Unsupported program to be wrapped!";
+	echo "       - only pdftex & pdflatex is allowed, but '$WRAPPED_PROGRAM' was provided.";
+	exit 101;
+}
+
+# Assert the underlying program is installed
+hash "$WRAPPED_PROGRAM" 2>/dev/null || {
+	echo "ERROR: You need to install $WRAPPED_PROGRAM first!";
+	exit 102;
+}
+
+# Print version if required
+[[ "$@" =~ -v ]] && {
+	echo "pdfTeX-quiet $VERSION";
+	"$WRAPPED_PROGRAM" --version;
+	exit $?;
+}
+
+# Print help if required (let's print it even if only -h is specified
+# although it's ambiguous because of -halt-on-error, but the regex should take care of that)
+[[ "$@" =~ -h([^a]|$) ]] && {
+	echo -e "Usage: $BASENAME [OPTION]... TEXNAME[.tex]\n";
+
+	# Print only arguments from the pdftex|pdflatex help
+	"$WRAPPED_PROGRAM" --help | grep --color=never -E '^[\[-]' -A500;
+	exit $?;
+}
+
+# FILENAME is always the last argument for pdftex|pdflatex
 # Create FILENAME variable only if there was provided some argument
 test $# -gt 0 && eval FILENAME=\${$#}
 
 # Test that the filename was provided
-test -z "$FILENAME" && { echo "It's mandatory to provide the filename of tex source as first argument!" && exit 1; }
+test -z "$FILENAME" && {
+	echo "It's mandatory to provide the filename of tex source as first argument!";
+	exit 103;
+}
 
 # Test the existence of the file provided
-test -f "$FILENAME" || test -f "$FILENAME.tex" || { echo "Last argument must be a file! Provided file '$FILENAME' doesn't exist!" && exit 2; }
+test -f "$FILENAME" || test -f "$FILENAME.tex" || {
+	echo "Last argument must be a file! Provided file '$FILENAME' doesn't exist!";
+	exit 104;
+}
 
-# Run pdftex on the file.
+# Run pdftex|pdflatex on the file.
 # Use -halt-on-error because grep basically disables the interactive mode.
-# Using $@ we also allow to pass all other arguments to the pdftex.
+# Using $@ we also allow to pass all other arguments to the pdftex|pdflatex.
 
 # Use grep to show only errors that occur with another 200 lines followed by the error.
 # Errors start with '!' at the line start. We match whole line to mark it in red bold color.
@@ -43,7 +88,7 @@
 # characters without finishing newline character (which is usually printed after user's input).
 
 : | \
-  pdftex --halt-on-error $@ | \
+  "$WRAPPED_PROGRAM" --halt-on-error $@ | \
   { ! grep --color=auto '^!.*' -A200; }
 
 EVERYTHING_SUCCEEDED=$?
@@ -65,7 +110,7 @@
   [[ "$@" =~ -output-format(=|[ ]*)dvi($|[ ]*) ]] && EXTENSION=dvi || EXTENSION=pdf
   [[ "$@" =~ -output-directory(=|[ ]*)([^ $]*) ]] && OUTPUT_DIRECTORY="${BASH_REMATCH[2]}/"
 
-  # Replace whatever extension we provided to pdftex with either dvi or pdf (based on arguments provided)
+  # Replace whatever extension we provided to pdftex|pdflatex with either dvi or pdf (based on arguments provided)
   OUTPUT_FILENAME="${FILENAME/%.*/.${EXTENSION}}"
 
   echo "Output file: '${OUTPUT_DIRECTORY}${OUTPUT_FILENAME}'"

Modified: trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl	2018-11-15 22:21:51 UTC (rev 49169)
@@ -33,7 +33,7 @@
 
 # declarations and utilities shared with install-tl-gui.tcl
 set ::instroot [exec kpsewhich -var-value=TEXMFROOT]
-source [file join $::instroot "tlpkg" "TeXLive" "tltcl.tcl"]
+source [file join $::instroot "tlpkg" "tltcl" "tltcl.tcl"]
 
 # searchpath and locale:
 # windows: most scripts run via [w]runscript, which adjusts the searchpath

Modified: trunk/Master/texmf-dist/doc/support/pdftex-quiet/LICENCE
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdftex-quiet/LICENCE	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Master/texmf-dist/doc/support/pdftex-quiet/LICENCE	2018-11-15 22:21:51 UTC (rev 49169)
@@ -632,7 +632,7 @@
 the "copyright" line and a pointer to where the full notice is found.
 
     pdftex-quiet
-    Copyright (C) 2018  productivity
+    Copyright (C) 2018  Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@
   If the program does terminal interaction, make it output a short
 notice like this when it starts in an interactive mode:
 
-    pdftex-quiet  Copyright (C) 2018  productivity
+    pdftex-quiet  Copyright (C) 2018  Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.

Modified: trunk/Master/texmf-dist/doc/support/pdftex-quiet/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdftex-quiet/README.md	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Master/texmf-dist/doc/support/pdftex-quiet/README.md	2018-11-15 22:21:51 UTC (rev 49169)
@@ -4,14 +4,23 @@
 
 Originally, I've started this as [the TeX StackExchange answer](https://tex.stackexchange.com/a/459470/134632).
 
-Now, it's being proposed as a CTAN package called also `pdftex-quiet`.
+Currently, [you can find this repository in a Comprehensive TeX Archive Network (CTAN)](https://ctan.org/pkg/pdftex-quiet) under `/support/pdftex-quiet`.
 
-## Installation
+## Quickinstall the latest version
 
+```bash
+curl -s https://gitlab.com/jirislav/pdftex-quiet/raw/latest/pdftex-quiet | \
+	sudo tee /usr/local/bin/pdftex-quiet >/dev/null \
+	&& sudo chmod +x /usr/local/bin/pdftex-quiet \
+	&& sudo ln -sf /usr/local/bin/pdf{,la}tex-quiet
+```
+
+## Installation from git
+
 Download this repository:
 
 ```bash
-git clone https://gitlab.jkozlovsky.cz/productivity/pdftex-quiet.git
+git clone https://gitlab.com/jirislav/pdftex-quiet.git
 cd pdftex-quiet
 ```
 
@@ -18,16 +27,16 @@
 Simply copy the bash script to your `$PATH`:
 
 ```bash
-cp bin/pdftex-quiet /usr/local/bin/
+cp pdftex-quiet /usr/local/bin/
 chmod +x /usr/local/bin/pdftex-quiet
 
 # Make sure we support also pdflatex-quiet command (pdflatex is also a symlink to pdftex command)
-ln -sf /usr/local/bin/pdftex-quiet /usr/local/bin/pdflatex-quiet
+ln -sf /usr/local/bin/pdf{,la}tex-quiet
 ```
 
 ## Usage
 
-Usage is the same as with `pdftex` (it supports all the arguments except [COMMANDS], **but the filename is mandatory!**).
+Usage is the same as with `pdftex` and `pdflatex` (it supports all the arguments except the `[COMMANDS]`, **but the filename is mandatory!**).
 
 ```bash
 # Keep in mind that the last argument should always be the filename to compile 
@@ -39,6 +48,9 @@
 
 # But most probably you simply want to run the pdftex without modifications:
 pdftex-quiet my_tex_source.tex
+
+# Also you might want to use LaTeX instead:
+pdflatex-quiet my_tex_source.tex
 ```
 
 ## Licence

Modified: trunk/Master/texmf-dist/doc/support/pdftex-quiet/VERSION
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdftex-quiet/VERSION	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Master/texmf-dist/doc/support/pdftex-quiet/VERSION	2018-11-15 22:21:51 UTC (rev 49169)
@@ -1 +1 @@
-v1.0.0
+v1.1.0

Modified: trunk/Master/texmf-dist/scripts/pdftex-quiet/pdftex-quiet
===================================================================
--- trunk/Master/texmf-dist/scripts/pdftex-quiet/pdftex-quiet	2018-11-15 22:21:25 UTC (rev 49168)
+++ trunk/Master/texmf-dist/scripts/pdftex-quiet/pdftex-quiet	2018-11-15 22:21:51 UTC (rev 49169)
@@ -1,36 +1,81 @@
 #!/bin/bash
 #
-# Author: Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
-# Licence: GNU GPLv3
-# Version: v1.0.0
+# pdftex-quiet
+# Copyright (C) 2018  Jiří Kozlovský <pdftex-quiet at jkozlovsky.cz>
 #
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Print help if required
-if [[ "$@" =~ -help ]]; then
-	echo "Usage: pdftex-quiet [OPTION]... TEXNAME[.tex]"
-	echo
+VERSION="v1.1.0"
 
-	# Print only arguments from the pdftex help
-	pdftex --help | grep --color=never -E '^[\[-]' -A500
-	exit $?
-fi
-
 # Do not ignore failures within the pipe
 set -o pipefail
 
-# FILENAME is always the last argument for pdftex
+# Get the script name
+BASENAME=`basename "$0"`
+
+# Remove the script's name '-quiet' suffix to get the underlying program to wrap
+WRAPPED_PROGRAM=${BASENAME/%-quiet}
+
+# Assert the wrapped program is either pdflatex or pdftex
+[[ "$WRAPPED_PROGRAM" =~ ^pdf(la)?tex$ ]] || {
+	echo "ERROR: Unsupported program to be wrapped!";
+	echo "       - only pdftex & pdflatex is allowed, but '$WRAPPED_PROGRAM' was provided.";
+	exit 101;
+}
+
+# Assert the underlying program is installed
+hash "$WRAPPED_PROGRAM" 2>/dev/null || {
+	echo "ERROR: You need to install $WRAPPED_PROGRAM first!";
+	exit 102;
+}
+
+# Print version if required
+[[ "$@" =~ -v ]] && {
+	echo "pdfTeX-quiet $VERSION";
+	"$WRAPPED_PROGRAM" --version;
+	exit $?;
+}
+
+# Print help if required (let's print it even if only -h is specified
+# although it's ambiguous because of -halt-on-error, but the regex should take care of that)
+[[ "$@" =~ -h([^a]|$) ]] && {
+	echo -e "Usage: $BASENAME [OPTION]... TEXNAME[.tex]\n";
+
+	# Print only arguments from the pdftex|pdflatex help
+	"$WRAPPED_PROGRAM" --help | grep --color=never -E '^[\[-]' -A500;
+	exit $?;
+}
+
+# FILENAME is always the last argument for pdftex|pdflatex
 # Create FILENAME variable only if there was provided some argument
 test $# -gt 0 && eval FILENAME=\${$#}
 
 # Test that the filename was provided
-test -z "$FILENAME" && { echo "It's mandatory to provide the filename of tex source as first argument!" && exit 1; }
+test -z "$FILENAME" && {
+	echo "It's mandatory to provide the filename of tex source as first argument!";
+	exit 103;
+}
 
 # Test the existence of the file provided
-test -f "$FILENAME" || test -f "$FILENAME.tex" || { echo "Last argument must be a file! Provided file '$FILENAME' doesn't exist!" && exit 2; }
+test -f "$FILENAME" || test -f "$FILENAME.tex" || {
+	echo "Last argument must be a file! Provided file '$FILENAME' doesn't exist!";
+	exit 104;
+}
 
-# Run pdftex on the file.
+# Run pdftex|pdflatex on the file.
 # Use -halt-on-error because grep basically disables the interactive mode.
-# Using $@ we also allow to pass all other arguments to the pdftex.
+# Using $@ we also allow to pass all other arguments to the pdftex|pdflatex.
 
 # Use grep to show only errors that occur with another 200 lines followed by the error.
 # Errors start with '!' at the line start. We match whole line to mark it in red bold color.
@@ -43,7 +88,7 @@
 # characters without finishing newline character (which is usually printed after user's input).
 
 : | \
-  pdftex --halt-on-error $@ | \
+  "$WRAPPED_PROGRAM" --halt-on-error $@ | \
   { ! grep --color=auto '^!.*' -A200; }
 
 EVERYTHING_SUCCEEDED=$?
@@ -65,7 +110,7 @@
   [[ "$@" =~ -output-format(=|[ ]*)dvi($|[ ]*) ]] && EXTENSION=dvi || EXTENSION=pdf
   [[ "$@" =~ -output-directory(=|[ ]*)([^ $]*) ]] && OUTPUT_DIRECTORY="${BASH_REMATCH[2]}/"
 
-  # Replace whatever extension we provided to pdftex with either dvi or pdf (based on arguments provided)
+  # Replace whatever extension we provided to pdftex|pdflatex with either dvi or pdf (based on arguments provided)
   OUTPUT_FILENAME="${FILENAME/%.*/.${EXTENSION}}"
 
   echo "Output file: '${OUTPUT_DIRECTORY}${OUTPUT_FILENAME}'"



More information about the tex-live-commits mailing list