texlive[46165] trunk: add wordcount.sh, debian bug 885341
commits+karl at tug.org
commits+karl at tug.org
Fri Dec 29 23:56:27 CET 2017
Revision: 46165
http://tug.org/svn/texlive?view=revision&revision=46165
Author: karl
Date: 2017-12-29 23:56:27 +0100 (Fri, 29 Dec 2017)
Log Message:
-----------
add wordcount.sh, debian bug 885341
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/wordcount.tlpsrc
Added Paths:
-----------
trunk/Build/source/texk/texlive/linked_scripts/wordcount/
trunk/Build/source/texk/texlive/linked_scripts/wordcount/wordcount.sh
trunk/Master/bin/amd64-freebsd/wordcount
trunk/Master/bin/amd64-netbsd/wordcount
trunk/Master/bin/armel-linux/wordcount
trunk/Master/bin/armhf-linux/wordcount
trunk/Master/bin/i386-cygwin/wordcount
trunk/Master/bin/i386-darwin/wordcount
trunk/Master/bin/i386-freebsd/wordcount
trunk/Master/bin/i386-linux/wordcount
trunk/Master/bin/i386-netbsd/wordcount
trunk/Master/bin/i386-solaris/wordcount
trunk/Master/bin/powerpc-darwin/wordcount
trunk/Master/bin/powerpc-linux/wordcount
trunk/Master/bin/sparc-solaris/wordcount
trunk/Master/bin/x86_64-cygwin/wordcount
trunk/Master/bin/x86_64-darwin/wordcount
trunk/Master/bin/x86_64-darwinlegacy/wordcount
trunk/Master/bin/x86_64-linux/wordcount
trunk/Master/bin/x86_64-solaris/wordcount
trunk/Master/texmf-dist/scripts/wordcount/
trunk/Master/texmf-dist/scripts/wordcount/wordcount.sh
Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.am 2017-12-29 21:30:13 UTC (rev 46164)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.am 2017-12-29 22:56:27 UTC (rev 46165)
@@ -83,7 +83,8 @@
texosquery/texosquery.sh \
texosquery/texosquery-jre5.sh \
texosquery/texosquery-jre8.sh \
- typeoutfileinfo/typeoutfileinfo.sh
+ typeoutfileinfo/typeoutfileinfo.sh \
+ wordcount/wordcount.sh
texmf_other_scripts = \
a2ping/a2ping.pl \
accfonts/mkt1font \
Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.in 2017-12-29 21:30:13 UTC (rev 46164)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.in 2017-12-29 22:56:27 UTC (rev 46165)
@@ -296,7 +296,8 @@
texosquery/texosquery.sh \
texosquery/texosquery-jre5.sh \
texosquery/texosquery-jre8.sh \
- typeoutfileinfo/typeoutfileinfo.sh
+ typeoutfileinfo/typeoutfileinfo.sh \
+ wordcount/wordcount.sh
texmf_other_scripts = \
a2ping/a2ping.pl \
Modified: trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/scripts.lst 2017-12-29 21:30:13 UTC (rev 46164)
+++ trunk/Build/source/texk/texlive/linked_scripts/scripts.lst 2017-12-29 22:56:27 UTC (rev 46165)
@@ -29,6 +29,7 @@
texosquery/texosquery-jre5.sh
texosquery/texosquery-jre8.sh
typeoutfileinfo/typeoutfileinfo.sh
+wordcount/wordcount.sh
a2ping/a2ping.pl
accfonts/mkt1font
accfonts/vpl2ovp
Added: trunk/Build/source/texk/texlive/linked_scripts/wordcount/wordcount.sh
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/wordcount/wordcount.sh (rev 0)
+++ trunk/Build/source/texk/texlive/linked_scripts/wordcount/wordcount.sh 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1,79 @@
+#!/bin/sh
+# wordcount.sh 1.7 Copyright 2016/06/03 Michael John Downes
+
+# Following Michael's death, his family have requested that his TeX
+# related files are made publicly available under the LPPL license.
+#
+# This file is available under the LaTeX Project Public License version 1
+# or (at your option) any later version.
+# https://latex-project.org/lppl/
+# (LPPL maintenance status: unmaintained)
+#
+# This is a Unix Bourne shell script that counts the characters and
+# spaces in a LaTeX document by running it through LaTeX using
+# wordcount.tex, and then counting the lines in the resulting
+# wordcount.log file that match a special pattern. It assumes that you
+# have a program "grep" with a -c option meaning "Report the number of
+# matching lines". To use perl or some other tool instead of grep,
+# redefine $COUNT in some suitable way, below.
+#
+# The characters that are counted with this method are actual font
+# characters in the page body (excluding running heads): in math, each
+# subscript and superscript character is counted separately, even when
+# they appear one over the other; and so are the separate combining
+# pieces used to make large delimiters. Interword spaces are counted as
+# separate characters, and so are the spaces around mathrel symbols in
+# math formulas (equal signs and the like)---but not the spaces around
+# mathbin symbols (plus, minus, and the like).
+#
+# You can count words by dividing the character count by 5 (or
+# whatever), or by counting the occurrences of interword spaces. The
+# latter method (illustrated here) is highly accurate at counting the
+# actual number of words---until tables or math formulas enter the
+# picture. In the case of tables, the number of words will tend to be
+# overestimated because tabskip glue, counted as an interword space,
+# appears on both sides of each table cell. (Not counting the tabskip
+# glue at all would result in an underestimate, and the underestimate
+# would tend to be slightly less accurate than the overestimate that we
+# have chosen to do.)
+#
+# And of course, in the case of math formulas, how do you define what is
+# a "word"?
+
+SCRIPT=`basename $0`
+LOGFILE=wordcount.log
+COUNT="grep -c"
+LATEX=latex
+
+die () {
+ echo "$@ was apparently unsuccessful."
+ exit 1
+}
+
+no_files_msg () {
+ echo "$SCRIPT: At least one file name must be supplied" \
+ "on the command line."
+ exit 1
+}
+
+case X$1 in
+ X) no_files_msg ;;
+ *) : ;;
+esac
+
+for f in "$@"
+do
+ # Since \? is not defined by LaTeX itself, this use via \csname causes
+ # it to be defined as \relax, and it then serves as a filename
+ # terminator. And within wordcount.tex if \? is found to be no longer
+ # undefined, certain messages are suppressed.
+ echo "$f" | $LATEX 'wordcount.tex\csname ?\endcsname' || die "LaTeX run"
+ # Count interword spaces and end-of-paragraph spaces
+ words=`$COUNT '3[.]0863[35]' $LOGFILE` || die "Log search"
+ # Count nonspace characters and interword spaces
+ chars=`$COUNT '3[.]0863[23]' $LOGFILE` || die "Log search"
+ # If you want to see what the log file looks like, comment out the
+ # following line:
+ rm $LOGFILE
+ echo "$f contains $chars characters and $words words."
+done
Property changes on: trunk/Build/source/texk/texlive/linked_scripts/wordcount/wordcount.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-freebsd/wordcount
===================================================================
--- trunk/Master/bin/amd64-freebsd/wordcount (rev 0)
+++ trunk/Master/bin/amd64-freebsd/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/amd64-freebsd/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-netbsd/wordcount
===================================================================
--- trunk/Master/bin/amd64-netbsd/wordcount (rev 0)
+++ trunk/Master/bin/amd64-netbsd/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/amd64-netbsd/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armel-linux/wordcount
===================================================================
--- trunk/Master/bin/armel-linux/wordcount (rev 0)
+++ trunk/Master/bin/armel-linux/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/armel-linux/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armhf-linux/wordcount
===================================================================
--- trunk/Master/bin/armhf-linux/wordcount (rev 0)
+++ trunk/Master/bin/armhf-linux/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/armhf-linux/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-cygwin/wordcount
===================================================================
--- trunk/Master/bin/i386-cygwin/wordcount (rev 0)
+++ trunk/Master/bin/i386-cygwin/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-cygwin/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-darwin/wordcount
===================================================================
--- trunk/Master/bin/i386-darwin/wordcount (rev 0)
+++ trunk/Master/bin/i386-darwin/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-darwin/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-freebsd/wordcount
===================================================================
--- trunk/Master/bin/i386-freebsd/wordcount (rev 0)
+++ trunk/Master/bin/i386-freebsd/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-freebsd/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-linux/wordcount
===================================================================
--- trunk/Master/bin/i386-linux/wordcount (rev 0)
+++ trunk/Master/bin/i386-linux/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-linux/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-netbsd/wordcount
===================================================================
--- trunk/Master/bin/i386-netbsd/wordcount (rev 0)
+++ trunk/Master/bin/i386-netbsd/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-netbsd/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-solaris/wordcount
===================================================================
--- trunk/Master/bin/i386-solaris/wordcount (rev 0)
+++ trunk/Master/bin/i386-solaris/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/i386-solaris/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/powerpc-darwin/wordcount
===================================================================
--- trunk/Master/bin/powerpc-darwin/wordcount (rev 0)
+++ trunk/Master/bin/powerpc-darwin/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/powerpc-darwin/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/powerpc-linux/wordcount
===================================================================
--- trunk/Master/bin/powerpc-linux/wordcount (rev 0)
+++ trunk/Master/bin/powerpc-linux/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/powerpc-linux/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/sparc-solaris/wordcount
===================================================================
--- trunk/Master/bin/sparc-solaris/wordcount (rev 0)
+++ trunk/Master/bin/sparc-solaris/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/sparc-solaris/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-cygwin/wordcount
===================================================================
--- trunk/Master/bin/x86_64-cygwin/wordcount (rev 0)
+++ trunk/Master/bin/x86_64-cygwin/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/x86_64-cygwin/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwin/wordcount
===================================================================
--- trunk/Master/bin/x86_64-darwin/wordcount (rev 0)
+++ trunk/Master/bin/x86_64-darwin/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/x86_64-darwin/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwinlegacy/wordcount
===================================================================
--- trunk/Master/bin/x86_64-darwinlegacy/wordcount (rev 0)
+++ trunk/Master/bin/x86_64-darwinlegacy/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/x86_64-darwinlegacy/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-linux/wordcount
===================================================================
--- trunk/Master/bin/x86_64-linux/wordcount (rev 0)
+++ trunk/Master/bin/x86_64-linux/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/x86_64-linux/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-solaris/wordcount
===================================================================
--- trunk/Master/bin/x86_64-solaris/wordcount (rev 0)
+++ trunk/Master/bin/x86_64-solaris/wordcount 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/wordcount/wordcount.sh
\ No newline at end of file
Property changes on: trunk/Master/bin/x86_64-solaris/wordcount
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/scripts/wordcount/wordcount.sh
===================================================================
--- trunk/Master/texmf-dist/scripts/wordcount/wordcount.sh (rev 0)
+++ trunk/Master/texmf-dist/scripts/wordcount/wordcount.sh 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1,79 @@
+#!/bin/sh
+# wordcount.sh 1.7 Copyright 2016/06/03 Michael John Downes
+
+# Following Michael's death, his family have requested that his TeX
+# related files are made publicly available under the LPPL license.
+#
+# This file is available under the LaTeX Project Public License version 1
+# or (at your option) any later version.
+# https://latex-project.org/lppl/
+# (LPPL maintenance status: unmaintained)
+#
+# This is a Unix Bourne shell script that counts the characters and
+# spaces in a LaTeX document by running it through LaTeX using
+# wordcount.tex, and then counting the lines in the resulting
+# wordcount.log file that match a special pattern. It assumes that you
+# have a program "grep" with a -c option meaning "Report the number of
+# matching lines". To use perl or some other tool instead of grep,
+# redefine $COUNT in some suitable way, below.
+#
+# The characters that are counted with this method are actual font
+# characters in the page body (excluding running heads): in math, each
+# subscript and superscript character is counted separately, even when
+# they appear one over the other; and so are the separate combining
+# pieces used to make large delimiters. Interword spaces are counted as
+# separate characters, and so are the spaces around mathrel symbols in
+# math formulas (equal signs and the like)---but not the spaces around
+# mathbin symbols (plus, minus, and the like).
+#
+# You can count words by dividing the character count by 5 (or
+# whatever), or by counting the occurrences of interword spaces. The
+# latter method (illustrated here) is highly accurate at counting the
+# actual number of words---until tables or math formulas enter the
+# picture. In the case of tables, the number of words will tend to be
+# overestimated because tabskip glue, counted as an interword space,
+# appears on both sides of each table cell. (Not counting the tabskip
+# glue at all would result in an underestimate, and the underestimate
+# would tend to be slightly less accurate than the overestimate that we
+# have chosen to do.)
+#
+# And of course, in the case of math formulas, how do you define what is
+# a "word"?
+
+SCRIPT=`basename $0`
+LOGFILE=wordcount.log
+COUNT="grep -c"
+LATEX=latex
+
+die () {
+ echo "$@ was apparently unsuccessful."
+ exit 1
+}
+
+no_files_msg () {
+ echo "$SCRIPT: At least one file name must be supplied" \
+ "on the command line."
+ exit 1
+}
+
+case X$1 in
+ X) no_files_msg ;;
+ *) : ;;
+esac
+
+for f in "$@"
+do
+ # Since \? is not defined by LaTeX itself, this use via \csname causes
+ # it to be defined as \relax, and it then serves as a filename
+ # terminator. And within wordcount.tex if \? is found to be no longer
+ # undefined, certain messages are suppressed.
+ echo "$f" | $LATEX 'wordcount.tex\csname ?\endcsname' || die "LaTeX run"
+ # Count interword spaces and end-of-paragraph spaces
+ words=`$COUNT '3[.]0863[35]' $LOGFILE` || die "Log search"
+ # Count nonspace characters and interword spaces
+ chars=`$COUNT '3[.]0863[23]' $LOGFILE` || die "Log search"
+ # If you want to see what the log file looks like, comment out the
+ # following line:
+ rm $LOGFILE
+ echo "$f contains $chars characters and $words words."
+done
Property changes on: trunk/Master/texmf-dist/scripts/wordcount/wordcount.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2017-12-29 21:30:13 UTC (rev 46164)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2017-12-29 22:56:27 UTC (rev 46165)
@@ -1202,7 +1202,6 @@
'winfonts', "die 'skipping, support for nonfree fonts'",
'withesis', "die 'skipping, thesis package ca.2002, wait for request'",
'wntamil', "die 'skipping, nonfree license'",
- 'wordcount', "&MAKEwordcount",
'wp-conv', "die 'skipping, nonfree license'",
'wp2latex', "die 'skipping, compilation'",
'wtref', "&MAKEflatten",
@@ -2911,6 +2910,7 @@
'ulqda' => '\.pl$',
'urlbst' => 'urlbst$',
'vpe' => '\.pl$',
+ 'wordcount' => '\.sh$',
'wheretotrim' => '\.pl$',
'yplan' => 'yplan$',
);
@@ -4825,19 +4825,6 @@
&SYSTEM ("rmdir $DEST/*/$whichformat/$package 2>/dev/null");
}
-
-sub MAKEwordcount {
- &xchdir ($packagedir);
- #
- print "\t SPECIAL $package: moving wordcount.sh to /tmp\n";
- &SYSTEM('mv wordcount.sh /tmp/');
- #
- &xchdir ("..");
- &donormal ();
- #
- print "YOU-MUST-DO! update /tmp/wordcount.sh to source/texk/texlive\n";
-}
-
sub MAKEukrhyph {
chdir($packagedir) || die ("ERROR: cannot open directory");
&runjob("mkdir -p $DEST/tex/generic/ukrhyph");
Modified: trunk/Master/tlpkg/tlpsrc/wordcount.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/wordcount.tlpsrc 2017-12-29 21:30:13 UTC (rev 46164)
+++ trunk/Master/tlpkg/tlpsrc/wordcount.tlpsrc 2017-12-29 22:56:27 UTC (rev 46165)
@@ -0,0 +1,2 @@
+binpattern f bin/${ARCH}/${PKGNAME}
+
More information about the tex-live-commits
mailing list