From d414b6d71faa91f77c6eadd6d58010bd66a5fca4 Mon Sep 17 00:00:00 2001
From: Landon Curt Noll
make all./rcm < rfc1951.gz./rcm < file.gzwhere file.gz is some gzipped file.
For more information try:
-./rcm < rfc1952.gz./try.shFor a good no-op try:
gzip -c < rcm.c | ./rcmNOTE: this is done in the try.sh script as well, +along with some other commands including a way to do the above command +but with more steps.
Except for some silly requirements regarding input validation, CRC checking, and similar unimportant fluff, this program is a fully diff --git a/1996/schweikh1/index.html b/1996/schweikh1/index.html index 7acf5012b..9893ffb8f 100644 --- a/1996/schweikh1/index.html +++ b/1996/schweikh1/index.html @@ -10,7 +10,7 @@ - + @@ -122,8 +122,9 @@ href="/temp-test-ioccc/location.html#DE">DE
./schweikh1To find the day that Easter falls on in the current year:
-./schweikh1 |grep $(date +%Y)To find the day that Easter falls on in the current year and to show +all Easter dates from 1582 to 2199:
+./try.shLook at the source. There is something very odd going on here. Where does the real code come from if everything is a C pre-processor diff --git a/1996/schweikh2/index.html b/1996/schweikh2/index.html index 2fb940fdd..20e7b6e2d 100644 --- a/1996/schweikh2/index.html +++ b/1996/schweikh2/index.html @@ -10,7 +10,7 @@ - + @@ -137,8 +137,8 @@ href="/temp-test-ioccc/location.html#DE">DE
while :; do grep -v '#' schweikh2.c; done(and we do too) which works with sh, bash,
ksh and zsh as well. Press ctrl-c to stop it.
-Observe how the try.sh script does this a number of
-times.
The original program, with only slight obfuscations, may be found in hunni.c. The perl script, - + @@ -133,11 +133,6 @@ output from various systems.
But still it is a useful utility. To use try:
./schweikh3and thanks for the virtual memories! :-)
-NOTE: On some systems such as SunOS, one may need to compile -with:
- ${CC} ${CFLAGS} \
- -I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \
- schweikh3.c -o schweikh3
You have to select maximum ANSI C conformance of your compiler. The source fails to compile under a C++ compiler due to the `new’ identifier which is a C++ reserved word:
-$ g++ schweikh3.c
-schweikh3.c:9: parse error before `new'
-schweikh3.c:16: parse error before `new'
-schweikh3.c:46: parse error before `void'
-schweikh3.c:65: parse error before `Lisp'
-schweikh3.c:68: parse error before `;'
-[...]
-schweikh3.c:91: confused by earlier errors, bailing out$ g++ schweikh3.c
+schweikh3.c:9: parse error before `new'
+schweikh3.c:16: parse error before `new'
+schweikh3.c:46: parse error before `void'
+schweikh3.c:65: parse error before `Lisp'
+schweikh3.c:68: parse error before `;'
+[...]
+schweikh3.c:91: confused by earlier errors, bailing outThe source fails to compile on compilers that recognize the inline keyword by default, e.g. gcc:
-$ gcc schweikh3.c
-schweikh3.c:46: parse error before `void'
-schweikh3.c: In function `main':
-schweikh3.c:91: parse error before `inline'
-schweikh3.c: At top level:
-schweikh3.c:97: parse error before `void'$ gcc schweikh3.c
+schweikh3.c:46: parse error before `void'
+schweikh3.c: In function `main':
+schweikh3.c:91: parse error before `inline'
+schweikh3.c: At top level:
+schweikh3.c:97: parse error before `void'The -ansi option to gcc fixes this.
The source fails to compile on obsolete systems with obsolete memory
models due to the identifier far (to be honest: this is
diff --git a/1996/westley/index.html b/1996/westley/index.html
index c814ea0f0..3682ec585 100644
--- a/1996/westley/index.html
+++ b/1996/westley/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/1998/banks/index.html b/1998/banks/index.html
index 4a53e5c6c..84793c642 100644
--- a/1998/banks/index.html
+++ b/1998/banks/index.html
@@ -10,7 +10,7 @@
-
+
@@ -118,8 +118,12 @@ Location: US
make allYou may redefine all the keys and the time step with predefined -macros. The author provided the following able:
+If you do not have a page up or page down key you might wish to see +the Alternate code section below. You may +redefine all the keys and the time step with predefined macros, however, +so one lacking page up / page down does not strictly need the alternate +code; it jut gives those controls a default value. The author provided +the following table:
Control Description Default Key
------- ------------------------- -----------
IT Increase throttle XK_Page_Up
@@ -181,21 +185,22 @@ side.
Alternate build:
As the Makefile allows you to configure the keys to use you may
redefine the keys but with the alt build you cannot, as described
-earlier, redefine the page up and page down replacement keys. If you
-want to do that you should use the original entry as described in the to
-build section above.
-In the alt build it is f and d respectively
-as these are letters on the left side of the keyboard which is easier to
-use if one is using the right side for movement. These are hard coded,
-as noted.
+earlier, redefine the page up and page down replacement keys. The other
+controls you may redefine; this is just a convenience build. If you want
+to redefine the page up / page down keys you should use the original
+entry as described in the to build section above.
+In the alt build it is f (for page up) and
+d (for page down) as these are letters on the left side of
+the keyboard which is easier to use if one is using the right side for
+movement. These are hard coded, as noted.
To use the default settings for the alternate build:
make alt
You may change the other keys as described in the build instructions,
above, but this alt code can be seen as an alternative for those who
don’t have or don’t want to use page up and page down.
Alternate use:
-Use banks.alt as you would banks but for
-use the different keys as configured at compilation.
+Use banks.alt as you would banks but use
+the different keys as configured at compilation.
Judges’ remarks:
What can we say? It’s a flight sim done in 1536 bytes of real code.
This one is a real marvel. When people say the size limits are too
diff --git a/1998/bas1/index.html b/1998/bas1/index.html
index 275012250..37a8c62cd 100644
--- a/1998/bas1/index.html
+++ b/1998/bas1/index.html
@@ -10,7 +10,7 @@
-
+
@@ -119,12 +119,7 @@ Location: NL
To build:
make all
To use:
-If lpr on your system can print PostScript:
-./bemazing | gunzip | lpr
-else, while in X Window System,
-./bemazing | gunzip | gv -
-or:
-./bemazing | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' -
+./bas1.sh
Judges’ remarks:
The output is supposed to be a 3D maze, but it is somewhat more than
that. If you’ve seen any of the
-
+
@@ -124,7 +124,9 @@ Location: NL
Try:
./try.sh
-./try.sh "foo bar" "baz" "IOCCC 1998/bas2" README.md
+./try.sh "foo bar" "baz" "IOCCC 1998/bas2" README.md
+
+./try.sh try.sh "bas2.c" bas2.orig.c
Can you determine the relationship between the input and the diff --git a/1998/chaos/index.html b/1998/chaos/index.html index f2df77c6c..c56b15a3a 100644 --- a/1998/chaos/index.html +++ b/1998/chaos/index.html @@ -10,7 +10,7 @@ - + @@ -125,6 +125,14 @@ have that library. Or you can build this entry without the
make chaos_nohalf./chaos./try.shThis script will run the program on each data file. To quit the
+program hit q. If not all files have been used it will go
+to the next one; otherwise the script will be finished. To end the
+script early send intr/ctrl-c.
The script will give you instructions on how to use the program and +things to try each time it is run, as a helpful reminder.
This is the author’s first IOCCC entry. We thought the entry was a nice example of a compact collection of obfuscations.
diff --git a/1998/df/index.html b/1998/df/index.html index 9710ae3a8..3e4fb6a0b 100644 --- a/1998/df/index.html +++ b/1998/df/index.html @@ -10,7 +10,7 @@ - + @@ -121,6 +121,11 @@ href="/temp-test-ioccc/location.html#null">unknownmake all./df./try.shThis will run the program in a loop until you exit (q
+when prompted or ctrl-c/intr).
Can you figure out a very simple pipeline to cheat?
Everyone talks about how data hiding can produce clearer code; I am pleased to offer this charming refutation.
@@ -138,6 +143,7 @@ tightly-coupled systems we used to have.This program lets you guess English words. It displays an underscore diff --git a/1998/dlowe/index.html b/1998/dlowe/index.html index f09e64c87..2590b2919 100644 --- a/1998/dlowe/index.html +++ b/1998/dlowe/index.html @@ -10,7 +10,7 @@ - + @@ -121,7 +121,9 @@ Location: US
There is an alternate version available. See Alternate code below for more details.
./dlowe < anyfile > pootfile./dlowe < file > pootfile
+
+./dlowe < fileThe current status of this entry is:
STATUS: missing or dead link - please provide them
@@ -133,16 +135,18 @@ dlowe in bugs.md.
Why is there different output?
Also try:
./try.shDid you spot the Easter egg there?
The original entry was just a text based pootifier. This alternate version is that program.
make alt./dlowe.alt < anyfile > pootfile
+./dlowe.alt < file > pootfile
What’s the difference between this and dlowe?
./try.alt.shDid you spot the Easter egg there?
Why could this this entry be considered a utility? Well because it is able to convert content-free web pages into useful web pages.
diff --git a/1998/dloweneil/index.html b/1998/dloweneil/index.html index 8822cfdb6..ffc067e20 100644 --- a/1998/dloweneil/index.html +++ b/1998/dloweneil/index.html @@ -10,7 +10,7 @@ - + @@ -133,13 +133,14 @@ href="/bugs.md#1998-dloweneil">1998 dloweneil in bugs.md.
./pootris [X size of board] [Y size of board]Pressing a moves the current letter position
-counterclockwise around the border of the playing field.
Pressing s moves the current letter one position
clockwise around the border of the playing field.
Pressing d drops the current letter onto the board.
This version has it so that where in addition to a
-moving you anticlockwise/counterclockwise h does as well;
+moving you counterclockwise/anticlockwise h does as well;
and in addition to s moving clockwise l does
as well. Instead of using d to drop the letter you can do
j or space. Finally to quit this version you can press
diff --git a/1998/dorssel/index.html b/1998/dorssel/index.html
index ac1ef7ba4..910d2ea76 100644
--- a/1998/dorssel/index.html
+++ b/1998/dorssel/index.html
@@ -10,7 +10,7 @@
-
+
@@ -126,8 +126,6 @@ href="/temp-test-ioccc/location.html#null">unknown
./try.shAlso try:
-./dorssel < dorssel.mdHow does the program decide which way to convert?
What obsolescent feature are we talking about? (No, it’s not a C @@ -148,8 +146,8 @@ by one without altering the behavior ?
Try doing what the last part of the last command in try.sh suggests. As in, do the following:
-echo ". -..- . .-. -.-. .. ... .
--.-. .... .- -. --. . - .... . .--. .-. --- --. .-. .- -- ... --- .. - -.. --- . ... -. --- - ... .... --- ..- -" | ./dorsselecho ". -..- . .-. -.-. .. ... .
+-.-. .... .- -. --. . - .... . .--. .-. --- --. .-. .- -- ... --- .. - -.. --- . ... -. --- - ... .... --- ..- -" | ./dorsseland make the necessary adjustments.
You might also want to read the dorssel.md file.
@@ -182,22 +180,22 @@ ASCII. As far as I can tell, the program is conforming and does not invoke undefined behavior.Try:
-./dorssel < dorssel.c | ./dorssel./dorssel < dorssel.c | ./dorsselto see what variables, numbers, and functions are used. (Does a better job than most C beautifiers).
./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorssel./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorsselis the same as
-./dorssel < dorssel.c | ./dorssel./dorssel < dorssel.c | ./dorssel./dorssel < dorssel.md./dorssel < dorssel.mdThis file is Copyright (c) 2023 by Landon Curt Noll. All Rights diff --git a/1998/fanf/index.html b/1998/fanf/index.html index d6eac676d..2b13ee2e6 100644 --- a/1998/fanf/index.html +++ b/1998/fanf/index.html @@ -10,7 +10,7 @@ - + diff --git a/1998/schnitzi/index.html b/1998/schnitzi/index.html index 53ba80d9c..9222a0180 100644 --- a/1998/schnitzi/index.html +++ b/1998/schnitzi/index.html @@ -10,7 +10,7 @@ - + diff --git a/1998/schweikh1/index.html b/1998/schweikh1/index.html index 852e392e7..a537a022a 100644 --- a/1998/schweikh1/index.html +++ b/1998/schweikh1/index.html @@ -10,7 +10,7 @@ - + diff --git a/1998/schweikh2/index.html b/1998/schweikh2/index.html index 1f299d2cd..8fe4361ce 100644 --- a/1998/schweikh2/index.html +++ b/1998/schweikh2/index.html @@ -10,7 +10,7 @@ - + @@ -124,11 +124,12 @@ href="/temp-test-ioccc/location.html#DE">DE
or
./yarng integer_number./yarng 5
+./try.sh
./yarng
# watch what it does
-What is the difference there?
+What is the difference between what is in the script and running
+yarng without an arg?
Judges’ remarks:
Run the program with a small argument, like 5 or 10, several times.
Are the results different? Why?
diff --git a/1998/schweikh3/index.html b/1998/schweikh3/index.html
index cba89e75d..c5fffa8cb 100644
--- a/1998/schweikh3/index.html
+++ b/1998/schweikh3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/1998/tomtorfs/index.html b/1998/tomtorfs/index.html
index 36b94f621..14f20dcab 100644
--- a/1998/tomtorfs/index.html
+++ b/1998/tomtorfs/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/anderson/index.html b/2000/anderson/index.html
index ad14131af..b9fc8890b 100644
--- a/2000/anderson/index.html
+++ b/2000/anderson/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/bellard/index.html b/2000/bellard/index.html
index 98e175315..4b3b58e92 100644
--- a/2000/bellard/index.html
+++ b/2000/bellard/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/bmeyer/index.html b/2000/bmeyer/index.html
index 3b372976e..c36ee9fe9 100644
--- a/2000/bmeyer/index.html
+++ b/2000/bmeyer/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/briddlebane/index.html b/2000/briddlebane/index.html
index 28f91e03b..8e66757d2 100644
--- a/2000/briddlebane/index.html
+++ b/2000/briddlebane/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/dhyang/index.html b/2000/dhyang/index.html
index f70d48422..193b1ab3d 100644
--- a/2000/dhyang/index.html
+++ b/2000/dhyang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/dlowe/index.html b/2000/dlowe/index.html
index 4f6fc3912..a77813293 100644
--- a/2000/dlowe/index.html
+++ b/2000/dlowe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/jarijyrki/index.html b/2000/jarijyrki/index.html
index 556319364..d44679c99 100644
--- a/2000/jarijyrki/index.html
+++ b/2000/jarijyrki/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/natori/index.html b/2000/natori/index.html
index d9c9a8f0b..357d223da 100644
--- a/2000/natori/index.html
+++ b/2000/natori/index.html
@@ -10,7 +10,7 @@
-
+
@@ -125,6 +125,8 @@ href="#alternate-code">alternate version below.
./natori
Try:
./try.sh
+Try running this on different days, say a few days apart, and each
+time run it several times in a row (or several times in a day).
Also try modifying the code so that it will show another Moon phase
based on input or else just by the code itself. Bonus points if you can
make it show all~
@@ -137,10 +139,16 @@ done in the alternate version.
make alt
Alternate use:
./natori.alt
+Try running this on different days, say a few days apart, and each
+time run it several times in a row (or several times in a day).
What happens if you run it in the northern hemisphere? Are there any
differences?
Can you identify any Moon phases that result in the same output of
both versions? Or are there any?
+Alternate try:
+./try.alt.sh
+Like with try.sh, try using this multiple
+times.
Judges’ remarks:
Here is a nice compact program that changes with the phase of the
Moon. Can you figure out how it does it?
diff --git a/2000/primenum/index.html b/2000/primenum/index.html
index cbeebb189..8985fbd02 100644
--- a/2000/primenum/index.html
+++ b/2000/primenum/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/rince/index.html b/2000/rince/index.html
index 29fd14a98..a7642b0e4 100644
--- a/2000/rince/index.html
+++ b/2000/rince/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/robison/index.html b/2000/robison/index.html
index 187255b65..cf5d23637 100644
--- a/2000/robison/index.html
+++ b/2000/robison/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/schneiderwent/index.html b/2000/schneiderwent/index.html
index 68e6edaa5..bdc066dc1 100644
--- a/2000/schneiderwent/index.html
+++ b/2000/schneiderwent/index.html
@@ -10,7 +10,7 @@
-
+
@@ -125,6 +125,9 @@ href="/temp-test-ioccc/location.html#US">US
./schneiderwent schneiderwent.data
./schneiderwent
What’s the difference?
+If you have a long while to spare (and you’re bored enough that you
+could watch paint dry :-) ) you might also try:
+./try.sh
Judges’ remarks:
Very nice play by the rules and portable text obfuscation. This far
surpasses old tricks like adding or subtracting 1 from every character
diff --git a/2000/thadgavin/index.html b/2000/thadgavin/index.html
index 3fd0291d3..053a7e06f 100644
--- a/2000/thadgavin/index.html
+++ b/2000/thadgavin/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2000/tomx/index.html b/2000/tomx/index.html
index f7d6a480c..45f8f3fd0 100644
--- a/2000/tomx/index.html
+++ b/2000/tomx/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/anonymous/index.html b/2001/anonymous/index.html
index c3a07c658..ea039995e 100644
--- a/2001/anonymous/index.html
+++ b/2001/anonymous/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/bellard/index.html b/2001/bellard/index.html
index 0391deec6..23c476908 100644
--- a/2001/bellard/index.html
+++ b/2001/bellard/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/cheong/index.html b/2001/cheong/index.html
index 4b7e29b7e..48f7d0acc 100644
--- a/2001/cheong/index.html
+++ b/2001/cheong/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/coupard/index.html b/2001/coupard/index.html
index e0e223abd..35fb56054 100644
--- a/2001/coupard/index.html
+++ b/2001/coupard/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/ctk/index.html b/2001/ctk/index.html
index b851bb718..4517c5634 100644
--- a/2001/ctk/index.html
+++ b/2001/ctk/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/dgbeards/index.html b/2001/dgbeards/index.html
index 269450d4c..7a8f63302 100644
--- a/2001/dgbeards/index.html
+++ b/2001/dgbeards/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/herrmann1/index.html b/2001/herrmann1/index.html
index 4971f48dd..75656950f 100644
--- a/2001/herrmann1/index.html
+++ b/2001/herrmann1/index.html
@@ -10,7 +10,7 @@
-
+
@@ -131,9 +131,7 @@ href="/bugs.md#2001-herrmann1">2001 herrmann1 in bugs.md.
compilation stage and as such if you wish to see that part like it was
designed you will need an older compiler perhaps gcc 2.95.
Try:
-./herrmann1.sh 'prg=herrmann1.times2'
--or-
-./herrmann1.sh 'prg=herrmann1.gcd'
+./try.sh
Judges’ remarks:
There are some clear hints in the source code as to the purpose of
this program. Perhaps the only way to figure out what is going on is to
@@ -172,7 +170,7 @@ terminal!
The info files herrmann1.turing and herrmann1.gcd are sample programs for the
Turing machine. For example, type
-./herrmann1.sh 'prg=herrmann1.times2'
+./herrmann1.sh 'prg=herrmann1.times2'
and watch the animated Turing machine multiply 8 by two (in unary
representation). Here’s a screen shot during compilation:
/*
@@ -197,7 +195,7 @@ result.)
In the previous example, the Turing machine started on the default
tape of the program times2.turing. To provide your own
tape, type (for example)
-./herrmann1 prg=times2.turing tape="O O O I I I O O O"
+./herrmann1 prg=times2.turing tape="O O O I I I O O O"
(The Os and Is are letters, not digits.)
You might prefer to provide only a finite portion of the tape, like I
did above. In this case, the remainder of the tape is filled with
@@ -215,12 +213,12 @@ better. Simply try some out.
number in unary representation. (That is, a row of I’s is expected, and
one more I is appended to the row.) Let’s call it
plus1.turing. Here’s what it could look like:
-/* Search beginning of number. */
-#define start_O O, right, start
-/* Number found. Move one step to the left. */
-#define start_I I, left, st2
-/* Write a I and stop */
-#define st2_O I, left, stop
+/* Search beginning of number. */
+#define start_O O, right, start
+/* Number found. Move one step to the left. */
+#define start_I I, left, st2
+/* Write a I and stop */
+#define st2_O I, left, stop
Some explanations: - The tape alphabet is always O and I. - The
states can be anything starting with “st”. “start” and “stop” are the
start and stop states, respectively. - To define a state, use two lines:
@@ -230,22 +228,22 @@ example, the line defining st2_I has been left out.) - The
order of the lines is irrelevant. - You may use C-style comments. (Would
you have guessed it?)
Now, the program can be used with
-./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
+./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
But what happens if no tape is provided? Up to now, the Turing
machine would start on an empty tape (that is, a tape filled with
Os). For many programs, this doesn’t make much sense (as is
the case for plus1.turing). So you might want to provide a
default tape by adding a line like
-#define tape O O O O O I I I I
+#define tape O O O O O I I I I
to your program.
Debugging
When writing long programs, the most common errors are to forget to
define a state or to misspell one. Let’s assume you forgot the line
-#define start_I I, left, st2
+#define start_I I, left, st2
Remove it and type
-./herrmann1 'prg=plus1.turing'
+./herrmann1 'prg=plus1.turing'
The output will be
Undefined state start.
Tape:
diff --git a/2001/herrmann2/index.html b/2001/herrmann2/index.html
index c751cd1b7..8dc2bdfa2 100644
--- a/2001/herrmann2/index.html
+++ b/2001/herrmann2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/jason/index.html b/2001/jason/index.html
index 6f9a3d02e..f20dda518 100644
--- a/2001/jason/index.html
+++ b/2001/jason/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/kev/index.html b/2001/kev/index.html
index 7d5b5f07f..c42e5b011 100644
--- a/2001/kev/index.html
+++ b/2001/kev/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/ollinger/index.html b/2001/ollinger/index.html
index e948d774b..e0d858612 100644
--- a/2001/ollinger/index.html
+++ b/2001/ollinger/index.html
@@ -10,7 +10,7 @@
-
+
@@ -122,7 +122,7 @@ href="/temp-test-ioccc/location.html#FR">FR
To use:
./ollinger integer
Try:
-./ollinger 1000 | cut -c -200
+./try.sh
Try the above command in a large window, say 200 chars wide and 100
high (200x100) with a tiny font.
Judges’ remarks:
diff --git a/2001/rosten/index.html b/2001/rosten/index.html
index d637e288d..50576f1c6 100644
--- a/2001/rosten/index.html
+++ b/2001/rosten/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/schweikh/index.html b/2001/schweikh/index.html
index ca9403732..1d3f6f78b 100644
--- a/2001/schweikh/index.html
+++ b/2001/schweikh/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/westley/index.html b/2001/westley/index.html
index b498fc4f2..3ec0c973a 100644
--- a/2001/westley/index.html
+++ b/2001/westley/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2001/williams/index.html b/2001/williams/index.html
index 33af7e70b..e6b77892c 100644
--- a/2001/williams/index.html
+++ b/2001/williams/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/anonymous/index.html b/2004/anonymous/index.html
index 17b38c4e3..13503d3f0 100644
--- a/2004/anonymous/index.html
+++ b/2004/anonymous/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/arachnid/index.html b/2004/arachnid/index.html
index 1de9bc6a3..9b36f67c0 100644
--- a/2004/arachnid/index.html
+++ b/2004/arachnid/index.html
@@ -10,7 +10,7 @@
-
+
@@ -124,7 +124,7 @@ down and up. See alternate code below.
To use:
./arachnid [mazefile]
Try:
-./arachnid arachnid.info
+./arachnid arachnid.txt
and then try:
./arachnid arachnid.c
Navigation is through the use of the wasd inverted-T
diff --git a/2004/burley/index.html b/2004/burley/index.html
index bced2086d..da561fd3b 100644
--- a/2004/burley/index.html
+++ b/2004/burley/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/gavare/index.html b/2004/gavare/index.html
index 117165e80..0fd205ab1 100644
--- a/2004/gavare/index.html
+++ b/2004/gavare/index.html
@@ -10,7 +10,7 @@
-
+
@@ -121,11 +121,20 @@ Location: SE
There are three alternate versions; see alternate code below for more details.
To use:
-./gavare
-Try:
-./gavare > ioccc_ray.ppm
+./gavare > ioccc_ray.ppm
+Open ioccc_ray.ppm with a viewer capable of viewing PPM
+files. Alternatively, if you have ImageMagick installed, you can convert
+it to a jpeg:
+convert ioccc_ray.ppm ioccc_ray.jpg
+and then view ioccc_ray.jpg in a graphics viewer, editor
+or web browser.
+Try:
+If you have xv(1) you can do:
+./gavare | xv -
+to not worry about writing it to a file and just viewing the image it
+creates.
Alternate code:
-The alt code, gavare.alt.c, allows you to
+
The alt code gavare.alt.c allows you to
change the size of the image as well as the anti-alias setting, when
compiling.
The author also provided on their web page for
the entry an unobfuscated version that was used during development,
which we have included in the file gavare.r3.c.
-Finally, there’s a version, gavare.alt2.c
-that sets binary mode on stdout which theoretically should
-work in Windows.
+Finally, the file gavare.alt2.c sets
+binary mode on stdout which theoretically should work in
+Windows.
Alternate build:
To build the configurable and unobfuscated versions:
-make alt
+make alt
To change the default size from 1024x768 try:
-make clobber XX=640 YY=480 alt
+make clobber XX=640 YY=480 alt
You might also wish to change the anti-alias setting:
-make clobber AA=2 alt
+make clobber AA=2 alt
+You may of course combine the above two commands and give any
+combination you wish.
This is not possible with the author’s version but it is with the alt
versions (Windows - see below - and otherwise).
As the Windows version will not compile on most viewers’ systems we
do not build it with make alt; instead try:
-make alt2
+make alt2
Alternate use:
Use gavare.alt, gavare.r3 or
gavare.alt2 as you would gavare above.
@@ -170,7 +181,7 @@ program I want to show that also non-trivial programs can be written
this way. This IOCCC entry contains no reserved words (I don’t count
main as a reserved word, although the compiler gives it
special meaning) and no preprocessor directives.
-The program is a small This program is a small ray-tracer.
The first line of the source code may be modified if you want the
resulting image to be of some other resolution than the predefined. The
diff --git a/2004/gavin/index.html b/2004/gavin/index.html
index 63a77c7ad..e9288e05e 100644
--- a/2004/gavin/index.html
+++ b/2004/gavin/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/hibachi/index.html b/2004/hibachi/index.html
index b09833c46..3c35e4f7b 100644
--- a/2004/hibachi/index.html
+++ b/2004/hibachi/index.html
@@ -10,7 +10,7 @@
-
+
@@ -121,13 +121,11 @@ href="/temp-test-ioccc/location.html#CA">CA
make
To use:
cd build; ./hibachi-start.sh &
-Try:
-cd build; ./hibachi-start.sh &
Then use your web browser to visit
http://localhost:8008/. When you’re finished make sure to
kill hibachi.
NOTE: you must be in the build directory when running
-hibachi for this to work.
+hibachi-start.sh for this to work right.
Judges’ remarks:
This entry violates the guidelines
in so many ways! We are not exactly sure how many organisations will be
@@ -142,11 +140,12 @@ but this was extracted so the file does not exist here.
README.TXT (Feb 2004)
Hibachi is a simple, small, and (probably) very secure
web server.
-There is a hibachi.tgz file that unpacks several support
-files and a subdirectory tree containing the documentation and examples.
-It can be viewed by:
-tar -zxf hibachi.tgz
-lynx hibachi/localhost/index.html
+There is a hibachi.tgz file (NOTE: this file was removed
+by the judges after extraction) that unpacks several support files and a
+subdirectory tree containing the documentation and examples. It can be
+viewed by:
+tar -zxf hibachi.tgz
+lynx hibachi/localhost/index.html
Or once Hibachi is running, use a web browser
(preferably one that supports images and JavaScript, to view the
documentation and try some of the CGI examples) to visit:
@@ -154,11 +153,11 @@ documentation and try some of the CGI examples) to visit:
Building
To build just the executable:
For Cygwin, FreeBSD, Linux (newer), Mac OS X:
-gcc -o hibachi hibachi.c
+gcc -o hibachi hibachi.c
For Linux (older):
-gcc -DSHUT_WR=1 -o hibachi hibachi.c
+gcc -DSHUT_WR=1 -o hibachi hibachi.c
For SunOS:
-gcc -o hibachi hibachi.c -lnsl -lsocket
+gcc -o hibachi hibachi.c -lnsl -lsocket
Since some systems place socket and network functions into other
libraries, a GNU
autoconf
./configure [--enable-port=number]
make
To start the server on the default port (8008):
-cd build;
-./hibachi-start.sh &
+cd build;
+./hibachi-start.sh &
To test the server:
-lynx http://localhost:8008/
+lynx http://localhost:8008/
To stop the server:
-kill %1
+kill %1
Features
Supports virtual hosts.
diff --git a/2004/hoyle/index.html b/2004/hoyle/index.html
index a62e0ba98..7626afd11 100644
--- a/2004/hoyle/index.html
+++ b/2004/hoyle/index.html
@@ -10,7 +10,7 @@
-
+
@@ -122,9 +122,7 @@ href="/temp-test-ioccc/location.html#US">US
To use:
./hoyle point ...
Try:
-./hoyle 10 0.5
-./hoyle 1 1 1 1
-./hoyle 2 0 1 0 -0.001
+./try.sh
Judges’ remarks:
The obfuscation functions at several levels. Note the clever use of
use of #defines. The #define do(if,else), for
@@ -137,7 +135,7 @@ coordinate system. Polynomials of the form
coefficients a, b, c, etc. as
double precision arguments. It allows up to 8 parameters (thus up to
x^7).
-Points of note:
+Points of interest:
- the x axis
goes from
-32 to +31.
@@ -147,7 +145,7 @@ auto scales!
href="https://en.wikipedia.org/wiki/Coefficient">coefficients may be
passed in.
- the graph will determine direction and use slashes and dashes rather
-than simple block
Xs.
+than a simple block of Xs.
For example, to graph y = x^2:
./hoyle 0 0 1
diff --git a/2004/jdalbec/index.html b/2004/jdalbec/index.html
index 122f72bbd..78561aef4 100644
--- a/2004/jdalbec/index.html
+++ b/2004/jdalbec/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/kopczynski/index.html b/2004/kopczynski/index.html
index 8329e04d2..92ed3e2ed 100644
--- a/2004/kopczynski/index.html
+++ b/2004/kopczynski/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/newbern/index.html b/2004/newbern/index.html
index 649e165c3..0477ccaa6 100644
--- a/2004/newbern/index.html
+++ b/2004/newbern/index.html
@@ -10,7 +10,7 @@
-
+
@@ -121,8 +121,7 @@ Location: unknown
To use:
./newbern [file.dat arg]
Try:
-./newbern newbern.dat "IOCCC 2004"
-echo SOS | ./newbern
+./try.sh
Judges’ remarks:
The program is formatted using the same font glyphs as the example
data file.
diff --git a/2004/omoikane/index.html b/2004/omoikane/index.html
index ca3ed867d..ad832caba 100644
--- a/2004/omoikane/index.html
+++ b/2004/omoikane/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/schnitzi/index.html b/2004/schnitzi/index.html
index f47d84b23..b7029de2b 100644
--- a/2004/schnitzi/index.html
+++ b/2004/schnitzi/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/sds/index.html b/2004/sds/index.html
index 05d2b2c94..93d9a9bb8 100644
--- a/2004/sds/index.html
+++ b/2004/sds/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/vik1/index.html b/2004/vik1/index.html
index 45a162e8f..2e5b9ce18 100644
--- a/2004/vik1/index.html
+++ b/2004/vik1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2004/vik2/index.html b/2004/vik2/index.html
index a7444685a..f0c4e632d 100644
--- a/2004/vik2/index.html
+++ b/2004/vik2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/aidan/index.html b/2005/aidan/index.html
index 01d886bff..5d8e9a155 100644
--- a/2005/aidan/index.html
+++ b/2005/aidan/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/anon/index.html b/2005/anon/index.html
index c16e455a1..0204a3ee7 100644
--- a/2005/anon/index.html
+++ b/2005/anon/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/boutines/index.html b/2005/boutines/index.html
index e069bf816..d37aabf0d 100644
--- a/2005/boutines/index.html
+++ b/2005/boutines/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/chia/index.html b/2005/chia/index.html
index 4a2d35e8c..4061d058c 100644
--- a/2005/chia/index.html
+++ b/2005/chia/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/giljade/index.html b/2005/giljade/index.html
index 1b5d0fd9e..a8d041d71 100644
--- a/2005/giljade/index.html
+++ b/2005/giljade/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/jetro/index.html b/2005/jetro/index.html
index 125e068ec..a59e09923 100644
--- a/2005/jetro/index.html
+++ b/2005/jetro/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/klausler/index.html b/2005/klausler/index.html
index 6a0a2c488..0b4fd15fc 100644
--- a/2005/klausler/index.html
+++ b/2005/klausler/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/mikeash/index.html b/2005/mikeash/index.html
index 45b621abf..da2a6cf61 100644
--- a/2005/mikeash/index.html
+++ b/2005/mikeash/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/mynx/index.html b/2005/mynx/index.html
index 51a3aec9c..58551d0d9 100644
--- a/2005/mynx/index.html
+++ b/2005/mynx/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/persano/index.html b/2005/persano/index.html
index cc10f8cbc..0b458756b 100644
--- a/2005/persano/index.html
+++ b/2005/persano/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/sykes/index.html b/2005/sykes/index.html
index b301a81dd..a709541cd 100644
--- a/2005/sykes/index.html
+++ b/2005/sykes/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/timwi/index.html b/2005/timwi/index.html
index f96378736..ae89ebe33 100644
--- a/2005/timwi/index.html
+++ b/2005/timwi/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/toledo/index.html b/2005/toledo/index.html
index e1c968f3d..60f709db7 100644
--- a/2005/toledo/index.html
+++ b/2005/toledo/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/vik/index.html b/2005/vik/index.html
index aed0dacf0..eb91371a5 100644
--- a/2005/vik/index.html
+++ b/2005/vik/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2005/vince/index.html b/2005/vince/index.html
index aef2df546..b369ba4f0 100644
--- a/2005/vince/index.html
+++ b/2005/vince/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/birken/index.html b/2006/birken/index.html
index f603983f5..a4e1a704c 100644
--- a/2006/birken/index.html
+++ b/2006/birken/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/borsanyi/index.html b/2006/borsanyi/index.html
index 28c0c2476..c2d4897b1 100644
--- a/2006/borsanyi/index.html
+++ b/2006/borsanyi/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/grothe/index.html b/2006/grothe/index.html
index 812d72ae0..ce59e30da 100644
--- a/2006/grothe/index.html
+++ b/2006/grothe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/hamre/index.html b/2006/hamre/index.html
index bd0c147d5..1c347befb 100644
--- a/2006/hamre/index.html
+++ b/2006/hamre/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/meyer/index.html b/2006/meyer/index.html
index ae722b969..55442b398 100644
--- a/2006/meyer/index.html
+++ b/2006/meyer/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/monge/index.html b/2006/monge/index.html
index 4fcd0803e..1dc6d9284 100644
--- a/2006/monge/index.html
+++ b/2006/monge/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/night/index.html b/2006/night/index.html
index 9db367282..80a5249a1 100644
--- a/2006/night/index.html
+++ b/2006/night/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/sloane/index.html b/2006/sloane/index.html
index de5a7728d..e0f5538a8 100644
--- a/2006/sloane/index.html
+++ b/2006/sloane/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/stewart/index.html b/2006/stewart/index.html
index 3d0522843..6f9d0eadc 100644
--- a/2006/stewart/index.html
+++ b/2006/stewart/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/sykes1/index.html b/2006/sykes1/index.html
index 75034b353..09bcb7b46 100644
--- a/2006/sykes1/index.html
+++ b/2006/sykes1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/sykes2/index.html b/2006/sykes2/index.html
index ece6789a5..310d65bc0 100644
--- a/2006/sykes2/index.html
+++ b/2006/sykes2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/toledo1/index.html b/2006/toledo1/index.html
index 78a07e2df..8ebeaadc3 100644
--- a/2006/toledo1/index.html
+++ b/2006/toledo1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/toledo2/index.html b/2006/toledo2/index.html
index d82f53474..10e68040d 100644
--- a/2006/toledo2/index.html
+++ b/2006/toledo2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2006/toledo3/index.html b/2006/toledo3/index.html
index fa19a5aaa..37f7f82f8 100644
--- a/2006/toledo3/index.html
+++ b/2006/toledo3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/akari/index.html b/2011/akari/index.html
index cd97f51f1..f67dd28ef 100644
--- a/2011/akari/index.html
+++ b/2011/akari/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/blakely/index.html b/2011/blakely/index.html
index ec376d600..7ab4edae0 100644
--- a/2011/blakely/index.html
+++ b/2011/blakely/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/borsanyi/index.html b/2011/borsanyi/index.html
index 0abb077e2..27a813e2e 100644
--- a/2011/borsanyi/index.html
+++ b/2011/borsanyi/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/dlowe/index.html b/2011/dlowe/index.html
index 2562ac21b..b2f910587 100644
--- a/2011/dlowe/index.html
+++ b/2011/dlowe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/eastman/index.html b/2011/eastman/index.html
index 30009d8ad..7deb9dae3 100644
--- a/2011/eastman/index.html
+++ b/2011/eastman/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/fredriksson/index.html b/2011/fredriksson/index.html
index 3663a4509..695b4cf94 100644
--- a/2011/fredriksson/index.html
+++ b/2011/fredriksson/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/goren/index.html b/2011/goren/index.html
index d0b6c02f2..48939e687 100644
--- a/2011/goren/index.html
+++ b/2011/goren/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/hamaji/index.html b/2011/hamaji/index.html
index 34618da77..7e6ce3d36 100644
--- a/2011/hamaji/index.html
+++ b/2011/hamaji/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/hou/index.html b/2011/hou/index.html
index bbb93a662..f285e5958 100644
--- a/2011/hou/index.html
+++ b/2011/hou/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/konno/index.html b/2011/konno/index.html
index c70541c26..1d5de1e68 100644
--- a/2011/konno/index.html
+++ b/2011/konno/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/richards/index.html b/2011/richards/index.html
index f08dada77..2212341b8 100644
--- a/2011/richards/index.html
+++ b/2011/richards/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/toledo/index.html b/2011/toledo/index.html
index c270c443a..4350e7c6e 100644
--- a/2011/toledo/index.html
+++ b/2011/toledo/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/vik/index.html b/2011/vik/index.html
index 53def5ce0..a79d1a28b 100644
--- a/2011/vik/index.html
+++ b/2011/vik/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2011/zucker/index.html b/2011/zucker/index.html
index af74909b3..e4a5e68fd 100644
--- a/2011/zucker/index.html
+++ b/2011/zucker/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/blakely/index.html b/2012/blakely/index.html
index a3b922e49..de087b363 100644
--- a/2012/blakely/index.html
+++ b/2012/blakely/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/deckmyn/index.html b/2012/deckmyn/index.html
index 584d5eb5d..cf2fc5cbe 100644
--- a/2012/deckmyn/index.html
+++ b/2012/deckmyn/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/dlowe/index.html b/2012/dlowe/index.html
index a1b749994..cfd20152d 100644
--- a/2012/dlowe/index.html
+++ b/2012/dlowe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/endoh1/index.html b/2012/endoh1/index.html
index cf64311e1..e8799100f 100644
--- a/2012/endoh1/index.html
+++ b/2012/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/endoh2/index.html b/2012/endoh2/index.html
index 56e28c37d..7fa838d8c 100644
--- a/2012/endoh2/index.html
+++ b/2012/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/grothe/index.html b/2012/grothe/index.html
index c3865feb7..4ee977256 100644
--- a/2012/grothe/index.html
+++ b/2012/grothe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/hamano/index.html b/2012/hamano/index.html
index f341cb279..aac0874f5 100644
--- a/2012/hamano/index.html
+++ b/2012/hamano/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/hou/index.html b/2012/hou/index.html
index 254ae1e66..8cbf22601 100644
--- a/2012/hou/index.html
+++ b/2012/hou/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/kang/index.html b/2012/kang/index.html
index f17dc1edd..6eb0b66ec 100644
--- a/2012/kang/index.html
+++ b/2012/kang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/konno/index.html b/2012/konno/index.html
index 23f7e5063..cd93f1c2f 100644
--- a/2012/konno/index.html
+++ b/2012/konno/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/omoikane/index.html b/2012/omoikane/index.html
index c6af4edf6..6b6480d1f 100644
--- a/2012/omoikane/index.html
+++ b/2012/omoikane/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/tromp/index.html b/2012/tromp/index.html
index 762c14fe5..c1e89a7ce 100644
--- a/2012/tromp/index.html
+++ b/2012/tromp/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/vik/index.html b/2012/vik/index.html
index 576134224..bd7cb3442 100644
--- a/2012/vik/index.html
+++ b/2012/vik/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2012/zeitak/index.html b/2012/zeitak/index.html
index 195d00217..9dacec8bf 100644
--- a/2012/zeitak/index.html
+++ b/2012/zeitak/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/birken/index.html b/2013/birken/index.html
index 4e2a1a5e1..337fe14c2 100644
--- a/2013/birken/index.html
+++ b/2013/birken/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/cable1/index.html b/2013/cable1/index.html
index 8abbb82eb..70581d4a3 100644
--- a/2013/cable1/index.html
+++ b/2013/cable1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/cable2/index.html b/2013/cable2/index.html
index 4843c4ae7..9f7361d00 100644
--- a/2013/cable2/index.html
+++ b/2013/cable2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/cable3/index.html b/2013/cable3/index.html
index 492688072..5c332c96f 100644
--- a/2013/cable3/index.html
+++ b/2013/cable3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/dlowe/index.html b/2013/dlowe/index.html
index f3b169273..0fdf35cc5 100644
--- a/2013/dlowe/index.html
+++ b/2013/dlowe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/endoh1/index.html b/2013/endoh1/index.html
index 74935d3c3..22c4361f1 100644
--- a/2013/endoh1/index.html
+++ b/2013/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/endoh2/index.html b/2013/endoh2/index.html
index 8380fc293..276bcfd38 100644
--- a/2013/endoh2/index.html
+++ b/2013/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/endoh3/index.html b/2013/endoh3/index.html
index 69bf0683f..c67a59648 100644
--- a/2013/endoh3/index.html
+++ b/2013/endoh3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/endoh4/index.html b/2013/endoh4/index.html
index 13b8b7564..b96e344ca 100644
--- a/2013/endoh4/index.html
+++ b/2013/endoh4/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/hou/index.html b/2013/hou/index.html
index d96a162d4..286f40b5a 100644
--- a/2013/hou/index.html
+++ b/2013/hou/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/mills/index.html b/2013/mills/index.html
index a498c2e27..d435e0dbd 100644
--- a/2013/mills/index.html
+++ b/2013/mills/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/misaka/index.html b/2013/misaka/index.html
index 2750aed21..7c298faa9 100644
--- a/2013/misaka/index.html
+++ b/2013/misaka/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/morgan1/index.html b/2013/morgan1/index.html
index 0cac00210..74e6afc94 100644
--- a/2013/morgan1/index.html
+++ b/2013/morgan1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/morgan2/index.html b/2013/morgan2/index.html
index ce30d1f27..f164590cb 100644
--- a/2013/morgan2/index.html
+++ b/2013/morgan2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2013/robison/index.html b/2013/robison/index.html
index 0da494e2c..9b20bbe42 100644
--- a/2013/robison/index.html
+++ b/2013/robison/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/birken/index.html b/2014/birken/index.html
index d94a15b21..09ac8133f 100644
--- a/2014/birken/index.html
+++ b/2014/birken/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/deak/index.html b/2014/deak/index.html
index 8ca15c28f..509bcd8bd 100644
--- a/2014/deak/index.html
+++ b/2014/deak/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/endoh1/index.html b/2014/endoh1/index.html
index 73da36697..5fc394cb0 100644
--- a/2014/endoh1/index.html
+++ b/2014/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/endoh2/index.html b/2014/endoh2/index.html
index 15deda0de..50c2f5e36 100644
--- a/2014/endoh2/index.html
+++ b/2014/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/maffiodo1/index.html b/2014/maffiodo1/index.html
index ce65b1dd8..a6a11ff1c 100644
--- a/2014/maffiodo1/index.html
+++ b/2014/maffiodo1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/maffiodo2/index.html b/2014/maffiodo2/index.html
index 9b15866fc..c608561af 100644
--- a/2014/maffiodo2/index.html
+++ b/2014/maffiodo2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/morgan/index.html b/2014/morgan/index.html
index 66aec45dd..97e31fe07 100644
--- a/2014/morgan/index.html
+++ b/2014/morgan/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/sinon/index.html b/2014/sinon/index.html
index be1248962..fe6ce8149 100644
--- a/2014/sinon/index.html
+++ b/2014/sinon/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/skeggs/index.html b/2014/skeggs/index.html
index 9cd0aca17..e67266d92 100644
--- a/2014/skeggs/index.html
+++ b/2014/skeggs/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/vik/index.html b/2014/vik/index.html
index d91782d10..ce191a733 100644
--- a/2014/vik/index.html
+++ b/2014/vik/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2014/wiedijk/index.html b/2014/wiedijk/index.html
index e61b3d44f..fc5807d70 100644
--- a/2014/wiedijk/index.html
+++ b/2014/wiedijk/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/burton/index.html b/2015/burton/index.html
index 91401e214..b7f5460b6 100644
--- a/2015/burton/index.html
+++ b/2015/burton/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/dogon/index.html b/2015/dogon/index.html
index be5b8f95e..557317a64 100644
--- a/2015/dogon/index.html
+++ b/2015/dogon/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/duble/index.html b/2015/duble/index.html
index 7b6779cf9..341d6f1c0 100644
--- a/2015/duble/index.html
+++ b/2015/duble/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/endoh1/index.html b/2015/endoh1/index.html
index bc18992fd..551f2365e 100644
--- a/2015/endoh1/index.html
+++ b/2015/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/endoh2/index.html b/2015/endoh2/index.html
index 77ab66d34..f9166ef34 100644
--- a/2015/endoh2/index.html
+++ b/2015/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/endoh3/index.html b/2015/endoh3/index.html
index 54e4c2905..4f29e7604 100644
--- a/2015/endoh3/index.html
+++ b/2015/endoh3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/endoh4/index.html b/2015/endoh4/index.html
index 43929f129..c1fd55bd4 100644
--- a/2015/endoh4/index.html
+++ b/2015/endoh4/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/hou/index.html b/2015/hou/index.html
index b19e5c47c..fea2e1ba7 100644
--- a/2015/hou/index.html
+++ b/2015/hou/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/howe/index.html b/2015/howe/index.html
index 7063ba687..d3e3802e6 100644
--- a/2015/howe/index.html
+++ b/2015/howe/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/mills1/index.html b/2015/mills1/index.html
index 6f4f1e91e..f0e5847e1 100644
--- a/2015/mills1/index.html
+++ b/2015/mills1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/mills2/index.html b/2015/mills2/index.html
index f30bd7e44..3b329b1b2 100644
--- a/2015/mills2/index.html
+++ b/2015/mills2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/muth/index.html b/2015/muth/index.html
index 8813d3d3d..89e6089d5 100644
--- a/2015/muth/index.html
+++ b/2015/muth/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/schweikhardt/index.html b/2015/schweikhardt/index.html
index 53317ea48..4913cb9bf 100644
--- a/2015/schweikhardt/index.html
+++ b/2015/schweikhardt/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2015/yang/index.html b/2015/yang/index.html
index 0f16a390f..1a58fcd90 100644
--- a/2015/yang/index.html
+++ b/2015/yang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/algmyr/index.html b/2018/algmyr/index.html
index bbc913667..5c209d965 100644
--- a/2018/algmyr/index.html
+++ b/2018/algmyr/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/anderson/index.html b/2018/anderson/index.html
index 514c234d6..28393ffcb 100644
--- a/2018/anderson/index.html
+++ b/2018/anderson/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/bellard/index.html b/2018/bellard/index.html
index 3600ecd8b..aa10e79f5 100644
--- a/2018/bellard/index.html
+++ b/2018/bellard/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/burton1/index.html b/2018/burton1/index.html
index 2d99c2035..a80b80abf 100644
--- a/2018/burton1/index.html
+++ b/2018/burton1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/burton2/index.html b/2018/burton2/index.html
index 274c1836a..92f50a0da 100644
--- a/2018/burton2/index.html
+++ b/2018/burton2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/ciura/index.html b/2018/ciura/index.html
index ac6cba9d6..2fb975d2c 100644
--- a/2018/ciura/index.html
+++ b/2018/ciura/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/endoh1/index.html b/2018/endoh1/index.html
index 1b47472ca..d9daa1a4c 100644
--- a/2018/endoh1/index.html
+++ b/2018/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/endoh2/index.html b/2018/endoh2/index.html
index 682ded9b4..edb9caf42 100644
--- a/2018/endoh2/index.html
+++ b/2018/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/ferguson/index.html b/2018/ferguson/index.html
index 89c9c2be6..6b6b1768c 100644
--- a/2018/ferguson/index.html
+++ b/2018/ferguson/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/giles/index.html b/2018/giles/index.html
index 054c9990c..115eb2420 100644
--- a/2018/giles/index.html
+++ b/2018/giles/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/hou/index.html b/2018/hou/index.html
index c0e1ef8d5..27bd61fe6 100644
--- a/2018/hou/index.html
+++ b/2018/hou/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/mills/index.html b/2018/mills/index.html
index 4d3ff99c0..5c573f063 100644
--- a/2018/mills/index.html
+++ b/2018/mills/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/poikola/index.html b/2018/poikola/index.html
index 77b17a314..7c0157fac 100644
--- a/2018/poikola/index.html
+++ b/2018/poikola/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/vokes/index.html b/2018/vokes/index.html
index b1df17720..38e54f909 100644
--- a/2018/vokes/index.html
+++ b/2018/vokes/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2018/yang/index.html b/2018/yang/index.html
index 3eeef15fd..d0eef0227 100644
--- a/2018/yang/index.html
+++ b/2018/yang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/adamovsky/index.html b/2019/adamovsky/index.html
index 732a36d80..1af33db75 100644
--- a/2019/adamovsky/index.html
+++ b/2019/adamovsky/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/burton/index.html b/2019/burton/index.html
index 02b185b6c..568a7faec 100644
--- a/2019/burton/index.html
+++ b/2019/burton/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/ciura/index.html b/2019/ciura/index.html
index 74aea88fd..73ebf2076 100644
--- a/2019/ciura/index.html
+++ b/2019/ciura/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/diels-grabsch1/index.html b/2019/diels-grabsch1/index.html
index a4183549a..02e9966f3 100644
--- a/2019/diels-grabsch1/index.html
+++ b/2019/diels-grabsch1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/diels-grabsch2/index.html b/2019/diels-grabsch2/index.html
index 791b06346..1a2fbaceb 100644
--- a/2019/diels-grabsch2/index.html
+++ b/2019/diels-grabsch2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/dogon/index.html b/2019/dogon/index.html
index b8a0b1b93..43a654515 100644
--- a/2019/dogon/index.html
+++ b/2019/dogon/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/duble/index.html b/2019/duble/index.html
index 0de3e8f15..afa6f1c13 100644
--- a/2019/duble/index.html
+++ b/2019/duble/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/endoh/index.html b/2019/endoh/index.html
index f9c3110b5..6b13a764e 100644
--- a/2019/endoh/index.html
+++ b/2019/endoh/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/giles/index.html b/2019/giles/index.html
index 74f11e52b..042c05941 100644
--- a/2019/giles/index.html
+++ b/2019/giles/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/karns/index.html b/2019/karns/index.html
index ae5875e16..1e6b9a55a 100644
--- a/2019/karns/index.html
+++ b/2019/karns/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/lynn/index.html b/2019/lynn/index.html
index ebd03aaac..af26a52de 100644
--- a/2019/lynn/index.html
+++ b/2019/lynn/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/mills/index.html b/2019/mills/index.html
index 25d0d5c2c..817f62501 100644
--- a/2019/mills/index.html
+++ b/2019/mills/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/poikola/index.html b/2019/poikola/index.html
index 006a60e08..ecdf8bf4d 100644
--- a/2019/poikola/index.html
+++ b/2019/poikola/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2019/yang/index.html b/2019/yang/index.html
index f18dd8203..7157b8177 100644
--- a/2019/yang/index.html
+++ b/2019/yang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/burton/index.html b/2020/burton/index.html
index e7ca6a8e8..996b5ab56 100644
--- a/2020/burton/index.html
+++ b/2020/burton/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/carlini/index.html b/2020/carlini/index.html
index 0efd38c6e..552e2cc2a 100644
--- a/2020/carlini/index.html
+++ b/2020/carlini/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/endoh1/index.html b/2020/endoh1/index.html
index 21965a0c7..a75a0cbaf 100644
--- a/2020/endoh1/index.html
+++ b/2020/endoh1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/endoh2/index.html b/2020/endoh2/index.html
index a4bdec246..7e09877f2 100644
--- a/2020/endoh2/index.html
+++ b/2020/endoh2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/endoh3/index.html b/2020/endoh3/index.html
index e825125dd..23fdede2a 100644
--- a/2020/endoh3/index.html
+++ b/2020/endoh3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/ferguson1/index.html b/2020/ferguson1/index.html
index ee2f72516..6d58c2e67 100644
--- a/2020/ferguson1/index.html
+++ b/2020/ferguson1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/ferguson2/index.html b/2020/ferguson2/index.html
index d74caee39..882606634 100644
--- a/2020/ferguson2/index.html
+++ b/2020/ferguson2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/giles/index.html b/2020/giles/index.html
index e18e9213d..9629c3dad 100644
--- a/2020/giles/index.html
+++ b/2020/giles/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/kurdyukov1/index.html b/2020/kurdyukov1/index.html
index 40b9d8d10..1d6e8fa95 100644
--- a/2020/kurdyukov1/index.html
+++ b/2020/kurdyukov1/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/kurdyukov2/index.html b/2020/kurdyukov2/index.html
index b48baa880..44cad8887 100644
--- a/2020/kurdyukov2/index.html
+++ b/2020/kurdyukov2/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/kurdyukov3/index.html b/2020/kurdyukov3/index.html
index 2b1b04bec..c3e60de7f 100644
--- a/2020/kurdyukov3/index.html
+++ b/2020/kurdyukov3/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/kurdyukov4/index.html b/2020/kurdyukov4/index.html
index 57a5997d9..bc1c55a17 100644
--- a/2020/kurdyukov4/index.html
+++ b/2020/kurdyukov4/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/otterness/index.html b/2020/otterness/index.html
index 26f3e2ab6..c082f7ad4 100644
--- a/2020/otterness/index.html
+++ b/2020/otterness/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/tsoj/index.html b/2020/tsoj/index.html
index a70f32546..ec555ddb9 100644
--- a/2020/tsoj/index.html
+++ b/2020/tsoj/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/2020/yang/index.html b/2020/yang/index.html
index a78b529e7..6c37f0d6a 100644
--- a/2020/yang/index.html
+++ b/2020/yang/index.html
@@ -10,7 +10,7 @@
-
+
diff --git a/bin/README.md b/bin/README.md
index bf33ca7d7..0f29c8f32 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -17,6 +17,18 @@ as well as various JSON files and other content from the
Run a command on all winning entries.
+For example:
+
+```sh
+bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+```
+
+Or for example:
+
+```sh
+bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+```
+
### [gen-author.sh](gen-author.sh)
@@ -43,6 +55,37 @@ Output manifest table from a winner .winner.json file.
Wrapper tool to run pandoc.
+### [quick-readme2index.sh](quick-readme2index.sh)
+
+Runs [readme2index.sh](readme2index.sh) if the winner directory
+does not have a non-empty `index.hmtl` file, or if either
+`.winner.json` or `README.md` is newer than the `index.hmtl` file.
+
+This is useful when only a few winners have been
+modified (resulting in an updated `.winner.json` file)
+or if the `README.md` of a few winners have been changed.
+
+While the [readme2index.sh](readme2index.sh) take a few
+seconds to run, when applied to 300+ winners,
+the extra time can add up.
+
+If only a few `index.hmtl` files need updating, then
+this command will only briefly pause while the
+slightly longer [readme2index.sh](readme2index.sh) is run:
+
+```sh
+bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+```
+
+**NOTE**: This command assumes that the relative
+modification times for `index.hmtl`, .winner.json`,
+and `README.md` are correct. If in doubt, use:
+
+```sh
+bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+```
+
+
### [readme2index.sh](readme2index.sh)
Convert README.md into index.html.
diff --git a/bin/all-run.sh b/bin/all-run.sh
index a5ae7bc34..e49ca4ef8 100755
--- a/bin/all-run.sh
+++ b/bin/all-run.sh
@@ -49,7 +49,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.1.1 2024-01-19"
+export VERSION="1.1.2 2024-01-20"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -73,6 +73,11 @@ export DOCROOT_URL_SLASH="/temp-test-ioccc/"
export NOOP=
export DO_NOT_PROCESS=
export EXIT_CODE="0"
+#
+export P_FLAG_FOUND=
+export CAP_P_FLAG_FOUND=
+export U_FLAG_FOUND=
+export CAP_U_FLAG_FOUND=
# usage
#
@@ -105,7 +110,6 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
tool the tool to run over all winners
tool_options tool command line options to use before YYYY/dir
- NOTE: You must use -- after the tool command line option and before 'tool_options'
Exit codes:
0 all OK
@@ -141,7 +145,7 @@ while getopts :hv:Vd:nNp:P:u:U: flag; do
N) DO_NOT_PROCESS="-N"
;;
p) PANDOC_WRAPPER="$OPTARG"
- ;;
+ P_FLAG_FOUND="-p" ;;
P) # parse -P optstr
case "$OPTARG" in
*"'"*)
@@ -159,10 +163,13 @@ while getopts :hv:Vd:nNp:P:u:U: flag; do
*) ;;
esac
PANDOC_WRAPPER_OPTSTR="$OPTARG"
+ CAP_P_FLAG_FOUND="-P"
;;
u) REPO_URL="$OPTARG"
+ U_FLAG_FOUND="-u"
;;
U) TOP_URL="$OPTARG"
+ CAP_U_FLAG_FOUND="-U"
;;
\?) echo "$0: ERROR: invalid option: -$OPTARG" 1>&2
echo 1>&2
@@ -210,6 +217,50 @@ case "$#" in
;;
esac
+# clear options we will add to tools
+#
+export OPTSTR=
+
+# add '-p tool' options to tool arguments
+#
+if [[ -n $P_FLAG_FOUND && -n $PANDOC_WRAPPER ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-p \"$PANDOC_WRAPPER\""
+ else
+ OPTSTR="$OPTSTR -p \"$PANDOC_WRAPPER\""
+ fi
+fi
+
+# add '-P optstr' options to tool arguments
+#
+if [[ -n $CAP_P_FLAG_FOUND && -n $PANDOC_WRAPPER_OPTSTR ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-P \"$PANDOC_WRAPPER_OPTSTR\""
+ else
+ OPTSTR="$OPTSTR -P \"$PANDOC_WRAPPER_OPTSTR\""
+ fi
+fi
+
+# add '-u repo_url' options to tool arguments
+#
+if [[ -n $U_FLAG_FOUND && -n $REPO_URL ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-u \"$REPO_URL\""
+ else
+ OPTSTR="$OPTSTR -u \"$REPO_URL\""
+ fi
+fi
+
+# add '-U top_url' options to tool arguments
+#
+if [[ -n $CAP_U_FLAG_FOUND && -n $TOP_URL ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-U \"$TOP_URL\""
+ else
+ OPTSTR="$OPTSTR -U \"$TOP_URL\""
+ fi
+fi
+
# verify that we have a topdir directory
#
REPO_NAME=$(basename "$REPO_URL")
@@ -324,6 +375,7 @@ if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: INC_DIR=$INC_DIR" 1>&2
echo "$0: debug[3]: BIN_PATH=$BIN_PATH" 1>&2
echo "$0: debug[3]: BIN_DIR=$BIN_DIR" 1>&2
+ echo "$0: debug[3]: OPTSTR=$OPTSTR" 1>&2
echo "$0: debug[3]: DO_NOT_PROCESS=$DO_NOT_PROCESS" 1>&2
echo "$0: debug[3]: NOOP=$NOOP" 1>&2
fi
@@ -479,11 +531,9 @@ for YYYY in $(< "$TOP_FILE"); do
#
if [[ -z $NOOP ]]; then
if [[ $V_FLAG -ge 5 ]]; then
- echo "$0: debug[5]: about to run: $TOOL -d \"$TOPDIR\" -p \"$PANDOC_WRAPPER\"" \
- "-P \"$PANDOC_WRAPPER_OPTSTR\" -u \"$REPO_URL\" -U \"$TOP_URL\" $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+ echo "$0: debug[5]: about to run: $TOOL $OPTSTR $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
fi
- eval "$TOOL" -d '"'"$TOPDIR"'"' -p '"'"$PANDOC_WRAPPER"'"' -P '"'"$PANDOC_WRAPPER_OPTSTR"'"' \
- -u '"'"$REPO_URL"'"' -U '"'"$TOP_URL"'"' "$TOOL_OPTIONS" '"'"$WINNER_PATH"'"'
+ eval "$TOOL" "$OPTSTR" "$TOOL_OPTIONS" '"'"$WINNER_PATH"'"'
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: tool: $TOOL failed, error: $status" 1>&2
@@ -494,8 +544,7 @@ for YYYY in $(< "$TOP_FILE"); do
# report disabled by -n
#
elif [[ $V_FLAG -ge 5 ]]; then
- echo "$0: debug[5]: because of -n, did not run: $TOOL -d \"$TOPDIR\" -p \"$PANDOC_WRAPPER\"" \
- "-P \"$PANDOC_WRAPPER_OPTSTR\" -u \"$REPO_URL\" -U \"$TOP_URL\" $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+ echo "$0: debug[5]: because of -n, did not run: $TOOL $OPTSTR $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
fi
# report disabled by -N
diff --git a/bin/quick-readme2index.sh b/bin/quick-readme2index.sh
new file mode 100755
index 000000000..bbcc3abcc
--- /dev/null
+++ b/bin/quick-readme2index.sh
@@ -0,0 +1,538 @@
+#!/usr/bin/env bash
+#
+# quick-readme2index.sh - quickly determine if readme2index.sh needs to be run
+#
+# If yyyy/dir/.winner.json exists and was modified newer than
+# yyyy/dir/index.html or of yyyy/dir/index.html does not exist,
+# then readme2index.sh will be run using the yyyy/dir option.
+#
+# If yyyy/dir/.winner.json does not exist, then an error will thrown.
+#
+# If yyyy/dir/.winner.json exists and was modified same or older than
+# yyyy/dir/index.html, then nothing will happen.
+#
+# This tool has only has command line options also found in all-run.sh,
+# which is a subset of the command line options available to readme2index.sh.
+#
+# If `index.html` is not a non-empty file, or of either `.winner.json`
+# and/or `README.md` is newer than `index.html`, only then `readme2index.sh`
+# is executed.
+#
+# Copyright (c) 2024 by Landon Curt Noll. All Rights Reserved.
+#
+# Permission to use, copy, modify, and distribute this software and
+# its documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright, this permission notice and text
+# this comment, and the disclaimer below appear in all of the following:
+#
+# supporting documentation
+# source copies
+# source works derived from this source
+# binaries derived from this source or from derived source
+#
+# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+#
+# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
+#
+# Share and enjoy! :-)
+
+# firewall - must be bash with a version 4.2 or later
+#
+# We must declare arrays with -ag or -Ag
+#
+if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then
+ echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2
+ exit 4
+fi
+# firewall - must be bash with a version 4.2 or later
+#
+# We must declare arrays with -ag or -Ag
+#
+if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then
+ echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2
+ exit 4
+fi
+
+# setup bash file matching
+#
+# Requires bash with a version 4.2 or later
+#
+shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded
+shopt -u failglob # disable error message if no matches are found
+shopt -u dotglob # disable matching files starting with .
+shopt -s globskipdots # enable never matching . nor ..
+shopt -u nocaseglob # disable strict case matching
+shopt -u extglob # enable extended globbing patterns
+shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
+
+# set variables referenced in the usage message
+#
+export VERSION="1.0 2024-01-20"
+NAME=$(basename "$0")
+export NAME
+export V_FLAG=0
+GIT_TOOL=$(type -P git)
+export GIT_TOOL
+if [[ -z "$GIT_TOOL" ]]; then
+ echo "$0: FATAL: git tool is not installed or not in PATH" 1>&2
+ exit 10
+fi
+"$GIT_TOOL" rev-parse --is-inside-work-tree >/dev/null 2>&1
+status="$?"
+if [[ $status -eq 0 ]]; then
+ TOPDIR=$("$GIT_TOOL" rev-parse --show-toplevel)
+fi
+export PANDOC_WRAPPER="bin/pandoc-wrapper.sh"
+export PANDOC_WRAPPER_OPTSTR="-f markdown -t html --fail-if-warnings=true"
+export REPO_URL="https://github.com/ioccc-src/temp-test-ioccc"
+export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
+export DOCROOT_URL_SLASH="/temp-test-ioccc/"
+#
+export NOOP=
+export DO_NOT_PROCESS=
+export EXIT_CODE="0"
+#
+export V_FLAG_FOUND=
+export P_FLAG_FOUND=
+export CAP_P_FLAG_FOUND=
+export U_FLAG_FOUND=
+export CAP_U_FLAG_FOUND=
+
+# usage
+#
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-p tool] [-P optstr] [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
+ tool [tool_options]
+
+ -h print help message and exit
+ -v level set verbosity level (def level: 0)
+ -V print version string and exit
+
+ -d topdir set topdir (def: $TOPDIR)
+ NOTE: The '-d topdir' is passed as leading options on tool command lines.
+
+ -n go thru the actions, but do not update any files (def: do the action)
+ NOTE: -n is passed to tool
+ -N do not process file, just parse arguments and ignore the file (def: process the file)
+ NOTE: -N disables running a tool
+
+ -p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use $PANDOC_WRAPPER)
+ NOTE: The '-p tool' is passed as leading options on tool command lines.
+ -P pandoc_opts run 'pandoc wrapper tool' with options found in 'optstr' (def: $PANDOC_WRAPPER_OPTSTR)
+ NOTE: The '-P pandoc_opts' is passed as leading options on tool command lines.
+ NOTE: The 'pandoc_opts' may not contain a single-quote, nor a double-quote.
+
+ -u repo_url Base level URL of target git repo (def: $REPO_URL)
+ NOTE: The '-u repo_url' is passed as leading options on tool command lines.
+ -U top_url Top level URL of web site where HTML files will be viewed (def: $TOP_URL)
+ NOTE: The '-U top_url' is passed as leading options on tool command lines.
+
+ tool the tool to run over all winners
+ tool_options tool command line options to use before YYYY/dir
+
+Exit codes:
+ 0 all OK
+ 1 readme2index.sh exited non-zero
+ 2 -h and help string printed or -V and version string printed
+ 3 command line error
+ 4 bash version is < 4.2
+ 5 readme2index.sh tool executable not found
+ 6 topdir, topdir/YYYY, or topdir/YYYY/dir is not in proper form
+ 7 missing non-empty readable .winner.json file
+ 8 missing non-empty readable README.md file
+ >= 10 < 200 internal error
+ >= 200 ((not used))
+
+$NAME version: $VERSION"
+
+# parse command line
+#
+while getopts :hv:Vd:nNp:P:u:U: flag; do
+ case "$flag" in
+ h) echo "$USAGE" 1>&2
+ exit 2
+ ;;
+ v) V_FLAG="$OPTARG"
+ V_FLAG_FOUND="-v"
+ ;;
+ V) echo "$VERSION"
+ exit 2
+ ;;
+ d) TOPDIR="$OPTARG"
+ ;;
+ n) NOOP="-n"
+ ;;
+ N) DO_NOT_PROCESS="-N"
+ ;;
+ p) PANDOC_WRAPPER="$OPTARG"
+ P_FLAG_FOUND="-p" ;;
+ P) # parse -P optstr
+ case "$OPTARG" in
+ *"'"*)
+ echo "$0: ERROR: in -P optstr, the optstr may not contain a single-quote character: $OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ *'"'*)
+ echo "$0: ERROR: in -P optstr, the optstr may not contain a double-quote character: $OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ *) ;;
+ esac
+ PANDOC_WRAPPER_OPTSTR="$OPTARG"
+ CAP_P_FLAG_FOUND="-P"
+ ;;
+ u) REPO_URL="$OPTARG"
+ U_FLAG_FOUND="-u"
+ ;;
+ U) TOP_URL="$OPTARG"
+ CAP_U_FLAG_FOUND="-U"
+ ;;
+ \?) echo "$0: ERROR: invalid option: -$OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ :) echo "$0: ERROR: option -$OPTARG requires an argument" 1>&2
+ echo 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+ *) echo "$0: ERROR: unexpected value from getopts: $flag" 1>&2
+ echo 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+ esac
+done
+#
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: debug level: $V_FLAG" 1>&2
+fi
+#
+# remove the options
+#
+shift $(( OPTIND - 1 ));
+#
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: file argument count: $#" 1>&2
+fi
+#
+# verify arg count and parse args
+#
+export TOOL_OPTIONS
+export WINNER_PATH
+case "$#" in
+0) echo "$0: ERROR: expected 1 or more args, found: $#" 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+1) WINNER_PATH="$1"
+ shift
+ ;;
+*) WINNER_PATH="$1"
+ shift
+ TOOL_OPTIONS="$*"
+ ;;
+esac
+
+# clear options we will add to the tool
+#
+export OPTSTR=
+
+# add '-p tool' options to tool arguments
+#
+if [[ -n $P_FLAG_FOUND && -n $PANDOC_WRAPPER ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-p \"$PANDOC_WRAPPER\""
+ else
+ OPTSTR="$OPTSTR -p \"$PANDOC_WRAPPER\""
+ fi
+fi
+
+# add '-P optstr' options to tool arguments
+#
+if [[ -n $CAP_P_FLAG_FOUND && -n $PANDOC_WRAPPER_OPTSTR ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-P \"$PANDOC_WRAPPER_OPTSTR\""
+ else
+ OPTSTR="$OPTSTR -P \"$PANDOC_WRAPPER_OPTSTR\""
+ fi
+fi
+
+# add '-u repo_url' options to tool arguments
+#
+if [[ -n $U_FLAG_FOUND && -n $REPO_URL ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-u \"$REPO_URL\""
+ else
+ OPTSTR="$OPTSTR -u \"$REPO_URL\""
+ fi
+fi
+
+# add '-U top_url' options to tool arguments
+#
+if [[ -n $CAP_U_FLAG_FOUND && -n $TOP_URL ]]; then
+ if [[ -z $OPTSTR ]]; then
+ OPTSTR="-U \"$TOP_URL\""
+ else
+ OPTSTR="$OPTSTR -U \"$TOP_URL\""
+ fi
+fi
+
+# verify that we have a topdir directory
+#
+REPO_NAME=$(basename "$REPO_URL")
+export REPO_NAME
+if [[ -z $TOPDIR ]]; then
+ echo "$0: ERROR: cannot find top of git repo directory" 1>&2
+ echo "$0: Notice: if needed: $GIT_TOOL clone $REPO_URL; cd $REPO_NAME" 1>&2
+ exit 6
+fi
+if [[ ! -d $TOPDIR ]]; then
+ echo "$0: ERROR: TOPDIR is not a directory: $TOPDIR" 1>&2
+ echo "$0: Notice: if needed: $GIT_TOOL clone $REPO_URL; cd $REPO_NAME" 1>&2
+ exit 6
+fi
+
+# verify that we have an author subdirectory
+#
+export AUTHOR_PATH="$TOPDIR/author"
+if [[ ! -d $AUTHOR_PATH ]]; then
+ echo "$0: ERROR: author is not a directory under topdir: $AUTHOR_PATH" 1>&2
+ exit 6
+fi
+export AUTHOR_DIR="author"
+
+# verify that we have an inc subdirectory
+#
+export INC_PATH="$TOPDIR/inc"
+if [[ ! -d $INC_PATH ]]; then
+ echo "$0: ERROR: inc is not a directory under topdir: $INC_PATH" 1>&2
+ exit 6
+fi
+export INC_DIR="inc"
+
+# verify that we have an bin subdirectory
+#
+export BIN_PATH="$TOPDIR/bin"
+if [[ ! -d $BIN_PATH ]]; then
+ echo "$0: ERROR: bin is not a directory under topdir: $BIN_PATH" 1>&2
+ exit 6
+fi
+export BIN_DIR="bin"
+
+# cd to topdir
+#
+if [[ ! -e $TOPDIR ]]; then
+ echo "$0: ERROR: cannot cd to non-existent path: $TOPDIR" 1>&2
+ exit 6
+fi
+if [[ ! -d $TOPDIR ]]; then
+ echo "$0: ERROR: cannot cd to a non-directory: $TOPDIR" 1>&2
+ exit 6
+fi
+export CD_FAILED
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: about to: cd $TOPDIR" 1>&2
+fi
+cd "$TOPDIR" || CD_FAILED="true"
+if [[ -n $CD_FAILED ]]; then
+ echo "$0: ERROR: cd $TOPDIR failed" 1>&2
+ exit 6
+fi
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: now in directory: $(/bin/pwd)" 1>&2
+fi
+
+# verify that WINNER_PATH is a winner directory
+#
+# WINNER_PATH must be in yyyy/dir form
+# yyyy must be a directory
+# yyyy must be a writable directory
+# yyyy/.year must be a non-empty file
+# yyyy/dir must be a directory
+# yyyy/dir/.path must be a non-empty file
+# WINNER_PATH must match the contents of yyyy/dir/.path
+# yyyy/dir/.winner.json must be a non-empty file
+#
+if [[ ! -d $WINNER_PATH ]]; then
+ echo "$0: ERROR: arg is not a directory: $WINNER_PATH" 1>&2
+ exit 6
+fi
+if [[ ! -w $WINNER_PATH ]]; then
+ echo "$0: ERROR: arg is not a writable directory: $WINNER_PATH" 1>&2
+ exit 6
+fi
+export YEAR_DIR=${WINNER_PATH%%/*}
+if [[ -z $YEAR_DIR ]]; then
+ echo "$0: ERROR: arg not in yyyy/dir form: $WINNER_PATH" 1>&2
+ exit 6
+fi
+export WINNER_DIR=${WINNER_PATH#*/}
+if [[ -z $WINNER_DIR ]]; then
+ echo "$0: ERROR: arg: $WINNER_PATH not in $YEAR_DIR/dir form: $WINNER_PATH" 1>&2
+ exit 6
+fi
+if [[ $WINNER_DIR = */* ]]; then
+ echo "$0: ERROR: dir from arg: $WINNER_PATH contains a /: $WINNER_DIR" 1>&2
+ exit 6
+fi
+if [[ ! -d $YEAR_DIR ]]; then
+ echo "$0: ERROR: yyyy from arg: $WINNER_PATH is not a directory: $YEAR_DIR" 1>&2
+ exit 6
+fi
+export WINNER_ID="${YEAR_DIR}_${WINNER_DIR}"
+export DOT_YEAR="$YEAR_DIR/.year"
+if [[ ! -s $DOT_YEAR ]]; then
+ echo "$0: ERROR: not a non-empty file: $DOT_YEAR" 1>&2
+ exit 6
+fi
+if [[ ! -d $YEAR_DIR/$WINNER_DIR ]]; then
+ echo "$0: ERROR: yyyy/dir from arg: $WINNER_PATH is not a directory: $YEAR_DIR/$WINNER_DIR" 1>&2
+ exit 6
+fi
+export DOT_PATH="$YEAR_DIR/$WINNER_DIR/.path"
+if [[ ! -s $DOT_PATH ]]; then
+ echo "$0: ERROR: not a non-empty file: $DOT_PATH" 1>&2
+ exit 6
+fi
+DOT_PATH_CONTENT=$(< "$DOT_PATH")
+if [[ $WINNER_PATH != "$DOT_PATH_CONTENT" ]]; then
+ echo "$0: ERROR: arg: $WINNER_PATH does not match $DOT_PATH contents: $DOT_PATH_CONTENT" 1>&2
+ exit 6
+fi
+export WINNER_JSON="$YEAR_DIR/$WINNER_DIR/.winner.json"
+if [[ ! -e $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json does not exist: $WINNER_JSON" 1>&2
+ exit 7
+fi
+if [[ ! -f $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json is not a file: $WINNER_JSON" 1>&2
+ exit 7
+fi
+if [[ ! -r $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json is not a readable file: $WINNER_JSON" 1>&2
+ exit 7
+fi
+if [[ ! -s $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json is not a non-empty readable file: $WINNER_JSON" 1>&2
+ exit 7
+fi
+export README_MD="$YEAR_DIR/$WINNER_DIR/README.md"
+if [[ ! -e $README_MD ]]; then
+ echo "$0: ERROR: README.md does not exist: $README_MD" 1>&2
+ exit 8
+fi
+if [[ ! -f $README_MD ]]; then
+ echo "$0: ERROR: README.md is not a file: $README_MD" 1>&2
+ exit 8
+fi
+if [[ ! -r $README_MD ]]; then
+ echo "$0: ERROR: README.md is not a readable file: $README_MD" 1>&2
+ exit 8
+fi
+if [[ ! -s $README_MD ]]; then
+ echo "$0: ERROR: README.md is not a non-empty readable file: $README_MD" 1>&2
+ exit 8
+fi
+export INDEX_HTML="$YEAR_DIR/$WINNER_DIR/index.html"
+
+# determine our readme2index.sh tool path
+#
+export TOOL="$BIN_DIR/readme2index.sh"
+
+# verify tool is executable
+#
+if [[ ! -e $TOOL ]]; then
+ echo "$0: ERROR: TOOL does not exist: $TOOL" 1>&2
+ exit 5
+fi
+if [[ ! -f $TOOL ]]; then
+ echo "$0: ERROR: TOOL is not a regular file: $TOOL" 1>&2
+ exit 5
+fi
+if [[ ! -x $TOOL ]]; then
+ echo "$0: ERROR: TOOL is not an executable file: $TOOL" 1>&2
+ exit 5
+fi
+
+# parameter debugging
+#
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: NAME=$NAME" 1>&2
+ echo "$0: debug[3]: YEAR_DIR=$YEAR_DIR" 1>&2
+ echo "$0: debug[3]: WINNER_DIR=$WINNER_DIR" 1>&2
+ echo "$0: debug[3]: WINNER_ID=$WINNER_ID" 1>&2
+ echo "$0: debug[3]: DOT_YEAR=$DOT_YEAR" 1>&2
+ echo "$0: debug[3]: DOT_PATH=$DOT_PATH" 1>&2
+ echo "$0: debug[3]: WINNER_JSON=$WINNER_JSON" 1>&2
+ echo "$0: debug[3]: REPO_URL=$REPO_URL" 1>&2
+ echo "$0: debug[3]: REPO_NAME=$REPO_NAME" 1>&2
+ echo "$0: debug[3]: TOP_URL=$TOP_URL" 1>&2
+ echo "$0: debug[3]: AUTHOR_PATH=$AUTHOR_PATH" 1>&2
+ echo "$0: debug[3]: AUTHOR_DIR=$AUTHOR_DIR" 1>&2
+ echo "$0: debug[3]: INC_PATH=$INC_PATH" 1>&2
+ echo "$0: debug[3]: INC_DIR=$INC_DIR" 1>&2
+ echo "$0: debug[3]: BIN_PATH=$BIN_PATH" 1>&2
+ echo "$0: debug[3]: BIN_DIR=$BIN_DIR" 1>&2
+ echo "$0: debug[3]: PANDOC_WRAPPER=$PANDOC_WRAPPER" 1>&2
+ echo "$0: debug[3]: PANDOC_WRAPPER_OPTSTR=$PANDOC_WRAPPER_OPTSTR" 1>&2
+ echo "$0: debug[3]: WINNER_JSON=$WINNER_JSON" 1>&2
+ echo "$0: debug[3]: README_MD=$README_MD" 1>&2
+ echo "$0: debug[3]: INDEX_HTML=$INDEX_HTML" 1>&2
+ echo "$0: debug[3]: TOOL=$TOOL" 1>&2
+ echo "$0: debug[3]: OPTSTR=$OPTSTR" 1>&2
+ echo "$0: debug[3]: TOOL_OPTIONS=$TOOL_OPTIONS" 1>&2
+ echo "$0: debug[3]: DO_NOT_PROCESS=$DO_NOT_PROCESS" 1>&2
+ echo "$0: debug[3]: NOOP=$NOOP" 1>&2
+fi
+
+# determine if we need to run the tool
+#
+# If the non-empty index.html is newer than the .winner.json file,
+#
+if [[ $V_FLAG -ge 5 ]]; then
+ ls -lRt "$INDEX_HTML" "$WINNER_JSON" "$README_MD" 2>/dev/null
+fi
+if [[ -s $INDEX_HTML && $INDEX_HTML -nt $WINNER_JSON && $INDEX_HTML -nt $README_MD ]]; then
+ if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: does not need to be updated: $INDEX_HTML" 1>&2
+ fi
+ exit 0
+fi
+
+# run the tool
+#
+if [[ -z $NOOP ]]; then
+
+ # run the tool
+ #
+ if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: about to run: $TOOL $OPTSTR $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+ fi
+ eval "$TOOL" "$OPTSTR" "$TOOL_OPTIONS" '"'"$WINNER_PATH"'"'
+ status="$?"
+ if [[ $status -ne 0 ]]; then
+ echo "$0: ERROR: tool: $TOOL failed, error: $status" 1>&2
+ exit 1
+ fi
+
+# report disabled by -n
+#
+elif [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: because of -n, did not run: $TOOL $OPTSTR $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+fi
+
+# All Done!!! -- Jessica Noll, Age 2
+#
+exit 0
diff --git a/bin/readme2index.sh b/bin/readme2index.sh
index 637165de1..59d67efa7 100755
--- a/bin/readme2index.sh
+++ b/bin/readme2index.sh
@@ -55,7 +55,7 @@ shopt -s lastpipe # run last command of a pipeline not executed in the backgroun
# set variables referenced in the usage message
#
-export VERSION="1.1 2024-01-16"
+export VERSION="1.1.1 2024-01-20"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -127,7 +127,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
NOTE: Multiple '-s token=value' are cumulative for the unique set of 'token's.
-S failure to replace a %%token%% is not an error (def: exit non-zero for non-substituted tokens)
- -o tool Use output tool, 'tool', to generate option lines (def: do not)
+ -o tool Use 'output tool' to generate option lines (def: do not)
-o . disable use of 'output tool' (def: do not use an 'output tool')
NOTE: -o may only be used in command_options and md2html.cfg cfg_options (getopt phases 0 and 2)
-O tool=optstr run the 'token replace' named 'tool' with options found in 'optstr' (def: do not add any options)
@@ -183,9 +183,13 @@ function global_variable_setup
export BEFORE_TOOL=
export BEFORE_TOOL_OPTSTR=
# PANDOC_WRAPPER set above the export USAGE line
+ export P_FLAG_FOUND=
# PANDOC_WRAPPER_OPTSTR set above the export USAGE line
+ export CAP_P_FLAG_FOUND=
# REPO_URL set above the export USAGE line
+ export U_FLAG_FOUND=
# TOP_URL set above the export USAGE line
+ export CAP_U_FLAG_FOUND=
export AFTER_TOOL=
export AFTER_TOOL_OPTSTR=
unset TOKEN
@@ -443,6 +447,7 @@ function parse_command_line
# change pandoc wrapper tool
PANDOC_WRAPPER="$OPTARG"
fi
+ P_FLAG_FOUND="-p"
;;
P) # parse -P optstr
case "$OPTARG" in
@@ -461,6 +466,7 @@ function parse_command_line
*) ;;
esac
PANDOC_WRAPPER_OPTSTR="$OPTARG"
+ CAP_P_FLAG_FOUND="-P"
;;
a) # parse: -a tool
if [[ $OPTARG == . ]]; then
@@ -620,8 +626,10 @@ function parse_command_line
OUTPUT_TOOL_OPTSTR[$NAME]="$VALUE"
;;
u) REPO_URL="$OPTARG"
+ U_FLAG_FOUND="-u"
;;
U) TOP_URL="$OPTARG"
+ CAP_U_FLAG_FOUND="-U"
;;
e) echo "$OPTARG" 1>&2
;;
@@ -644,6 +652,168 @@ function parse_command_line
;;
esac
done
+
+ # clear options we will add to tools
+ #
+ export B_OPTSTR=
+ export P_OPTSTR=
+ export A_OPTSTR=
+ export O_OPTSTR=
+
+ # add '-p tool' options to tool arguments
+ #
+ if [[ -n $P_FLAG_FOUND && -n $PANDOC_WRAPPER ]]; then
+
+ # add '-p tool' to '-b before tool'
+ #
+ if [[ -z $B_OPTSTR ]]; then
+ B_OPTSTR="-p \"$PANDOC_WRAPPER\""
+ else
+ B_OPTSTR="$B_OPTSTR -p \"$PANDOC_WRAPPER\""
+ fi
+
+ # we do not add '-p tool' to 'pandoc wrapper tool'
+ # instead we simply execute $PANDOC_WRAPPER\
+
+ # add '-p tool' to '-a after tool'
+ #
+ if [[ -z $A_OPTSTR ]]; then
+ A_OPTSTR="-p \"$PANDOC_WRAPPER\""
+ else
+ A_OPTSTR="$A_OPTSTR -p \"$PANDOC_WRAPPER\""
+ fi
+ fi
+
+ # add '-P optstr' options to tool arguments
+ #
+ if [[ -n $CAP_P_FLAG_FOUND && -n $PANDOC_WRAPPER_OPTSTR ]]; then
+
+ # add '-P optstr' to '-b before tool'
+ #
+ if [[ -z $B_OPTSTR ]]; then
+ B_OPTSTR="-P \"$PANDOC_WRAPPER_OPTSTR\""
+ else
+ B_OPTSTR="$B_OPTSTR -P \"$PANDOC_WRAPPER_OPTSTR\""
+ fi
+
+ # add '-P optstr' to '-a after tool'
+ #
+ if [[ -z $A_OPTSTR ]]; then
+ A_OPTSTR="-P \"$PANDOC_WRAPPER_OPTSTR\""
+ else
+ A_OPTSTR="$A_OPTSTR -P \"$PANDOC_WRAPPER_OPTSTR\""
+ fi
+ fi
+
+ # add '-u repo_url' options to tool arguments
+ #
+ if [[ -n $U_FLAG_FOUND && -n $REPO_URL ]]; then
+
+ # add '-u repo_url' to '-b before tool'
+ #
+ if [[ -z $B_OPTSTR ]]; then
+ B_OPTSTR="-u \"$REPO_URL\""
+ else
+ B_OPTSTR="$B_OPTSTR -u \"$REPO_URL\""
+ fi
+
+ # add '-u repo_url' to '-p pandoc wrapper tool'
+ #
+ if [[ -z $P_OPTSTR ]]; then
+ P_OPTSTR="-u \"$REPO_URL\""
+ else
+ P_OPTSTR="$P_OPTSTR -u \"$REPO_URL\""
+ fi
+
+ # add '-u repo_url' to '-a after tool'
+ #
+ if [[ -z $A_OPTSTR ]]; then
+ A_OPTSTR="-u \"$REPO_URL\""
+ else
+ A_OPTSTR="$A_OPTSTR -u \"$REPO_URL\""
+ fi
+
+ # add '-u repo_url' to '-o output tool'
+ #
+ if [[ -z $O_OPTSTR ]]; then
+ O_OPTSTR="-u \"$REPO_URL\""
+ else
+ O_OPTSTR="$O_OPTSTR -u \"$REPO_URL\""
+ fi
+ fi
+
+ # add '-U top_url' options to tool arguments
+ #
+ if [[ -n $CAP_U_FLAG_FOUND && -n $TOP_URL ]]; then
+
+ # add '-U top_url' to '-b before tool'
+ #
+ if [[ -z $B_OPTSTR ]]; then
+ B_OPTSTR="-U \"$TOP_URL\""
+ else
+ B_OPTSTR="$B_OPTSTR -U \"$TOP_URL\""
+ fi
+
+ # add '-U top_url' to '-p pandoc wrapper tool'
+ #
+ if [[ -z $P_OPTSTR ]]; then
+ P_OPTSTR="-U \"$TOP_URL\""
+ else
+ P_OPTSTR="$P_OPTSTR -U \"$TOP_URL\""
+ fi
+
+ # add '-U top_url' to '-a after tool'
+ #
+ if [[ -z $A_OPTSTR ]]; then
+ A_OPTSTR="-U \"$TOP_URL\""
+ else
+ A_OPTSTR="$A_OPTSTR -U \"$TOP_URL\""
+ fi
+
+ # add '-U top_url' to '-o output tool'
+ #
+ if [[ -z $O_OPTSTR ]]; then
+ # SC2089 (warning): Quotes/backslashes will be treated literally. Use an array.
+ # https://www.shellcheck.net/wiki/SC2089
+ # shellcheck disable=SC2089
+ O_OPTSTR="-U \"$TOP_URL\""
+ else
+ O_OPTSTR="$O_OPTSTR -U \"$TOP_URL\""
+ fi
+ fi
+
+ # always add '-B optstr' to '-b before tool'
+ #
+ if [[ -n $BEFORE_TOOL_OPTSTR ]]; then
+ if [[ -z $B_OPTSTR ]]; then
+ B_OPTSTR="$BEFORE_TOOL_OPTSTR"
+ else
+ B_OPTSTR="$B_OPTSTR \"$BEFORE_TOOL_OPTSTR\""
+ fi
+ fi
+
+ # always add '-P optstr' to '-p pandoc wrapper tool'
+ #
+ if [[ -n $PANDOC_WRAPPER_OPTSTR ]]; then
+ if [[ -z $P_OPTSTR ]]; then
+ # SC2089 (warning): Quotes/backslashes will be treated literally. Use an array.
+ # https://www.shellcheck.net/wiki/SC2089
+ # shellcheck disable=SC2089
+ P_OPTSTR="-P \"$PANDOC_WRAPPER_OPTSTR\""
+ else
+ P_OPTSTR="$P_OPTSTR -P \"$PANDOC_WRAPPER_OPTSTR\""
+ fi
+ fi
+
+ # always add '-A optstr' to '-a after tool'
+ #
+ if [[ -n $AFTER_TOOL_OPTSTR ]]; then
+ if [[ -z $A_OPTSTR ]]; then
+ A_OPTSTR="$AFTER_TOOL_OPTSTR"
+ else
+ A_OPTSTR="$A_OPTSTR $AFTER_TOOL_OPTSTR"
+ fi
+ fi
}
#################################
@@ -872,11 +1042,11 @@ parse_command_line "$@"
# parse the command line arguments
#
-if [[ $V_FLAG -ge 1 ]]; then
- echo "$0: debug[1]: debug level: $V_FLAG" 1>&2
-fi
if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: after parse_command_line of getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+ echo "$0: debug[3]: debug level: $V_FLAG" 1>&2
+fi
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: after parse_command_line of getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
#
shift $(( OPTIND - 1 ));
@@ -890,8 +1060,8 @@ if [[ $# -ne 1 ]]; then
fi
#
export WINNER_PATH="$1"
-if [[ $V_FLAG -ge 1 ]]; then
- echo "$0: debug[1]: WINNER_PATH=$WINNER_PATH" 1>&2
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: WINNER_PATH=$WINNER_PATH" 1>&2
fi
# verify that we have a topdir directory
@@ -1092,8 +1262,8 @@ if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: NOOP=$NOOP" 1>&2
fi
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
##################
@@ -1104,8 +1274,8 @@ fi
#
GETOPT_PHASE=1
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
# run output tools and parse output as more options
@@ -1145,14 +1315,14 @@ for n in "${!OUTPUT_TOOL[@]}"; do
VALUE="${OUTPUT_TOOL[$n]}"
if [[ $V_FLAG -ge 7 ]]; then
echo "$0: debug[7]: phase ${GETOPT_PHASE} about to call output tool:" \
- "$VALUE ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- ${WINNER_PATH}" 1>&2
+ "$VALUE $O_OPTSTR ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- ${WINNER_PATH}" 1>&2
fi
# SC2046 (warning): Quote this to prevent word splitting.
# https://www.shellcheck.net/wiki/SC2046
# SC2086 (info): Double quote to prevent globbing and word splitting.
# https://www.shellcheck.net/wiki/SC2086
# shellcheck disable=SC2046,SC2086
- OUTPUT_TOOL_OUTPUT=$("$VALUE" ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}")
+ OUTPUT_TOOL_OUTPUT=$(eval "$VALUE" $O_OPTSTR ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}")
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: phase ${GETOPT_PHASE} $VALUE output starts below" 1>&2
echo "$OUTPUT_TOOL_OUTPUT" 1>&2
@@ -1193,8 +1363,8 @@ declare -ag OUTPUT_TOOL
unset OUTPUT_TOOL_OPTSTR
declare -Ag OUTPUT_TOOL_OPTSTR
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
##################
@@ -1205,8 +1375,8 @@ fi
#
GETOPT_PHASE=2
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
# find the first match md2html.cfg for README_PATH
@@ -1231,8 +1401,8 @@ parse_command_line "$@"
# parse the command line arguments
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: after phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: after phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
#
shift $(( OPTIND - 1 ));
@@ -1245,8 +1415,8 @@ if [[ $# -ne 0 ]]; then
exit 3
fi
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
##################
@@ -1257,8 +1427,8 @@ fi
#
GETOPT_PHASE=3
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
# run output tools and parse output as more options
@@ -1305,7 +1475,7 @@ for n in "${!OUTPUT_TOOL[@]}"; do
# SC2086 (info): Double quote to prevent globbing and word splitting.
# https://www.shellcheck.net/wiki/SC2086
# shellcheck disable=SC2046,SC2086
- OUTPUT_TOOL_OUTPUT=$("$VALUE" ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}")
+ OUTPUT_TOOL_OUTPUT=$(eval "$VALUE" $O_OPTSTR ${OUTPUT_TOOL_OPTSTR[$VALUE]} -- "${WINNER_PATH}")
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: phase ${GETOPT_PHASE} $VALUE output starts below" 1>&2
echo "$OUTPUT_TOOL_OUTPUT" 1>&2
@@ -1346,8 +1516,8 @@ declare -ag OUTPUT_TOOL
unset OUTPUT_TOOL_OPTSTR
declare -Ag OUTPUT_TOOL_OPTSTR
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: end getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
############################################
@@ -1358,11 +1528,11 @@ fi
#
GETOPT_PHASE=4
#
-if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: begin getopt phase ${GETOPT_PHASE} debug level: $V_FLAG" 1>&2
fi
-if [[ $V_FLAG -ge 1 ]]; then
- echo "$0: debug[1]: finished all getopt parsing" 1>&2
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: finished all getopt parsing" 1>&2
fi
# validate HTML phase names
@@ -1463,9 +1633,9 @@ fi
# report TOKEN sed patterns
#
-if [[ $V_FLAG -ge 5 ]]; then
+if [[ $V_FLAG -ge 7 ]]; then
for n in "${!TOKEN[@]}"; do
- echo "$0: debug[5]: -s token replacement: sed -e s;%%$n%%;${TOKEN[$n]};g" 1>&2
+ echo "$0: debug[7]: -s token replacement: sed -e s;%%$n%%;${TOKEN[$n]};g" 1>&2
done
fi
@@ -1509,10 +1679,10 @@ if [[ -z $NOOP ]]; then
for n in "${!TOKEN[@]}"; do
echo "s;%%$n%%;${TOKEN[$n]};g" >> "$TMP_SED_SCRIPT"
done
- if [[ $V_FLAG -ge 3 ]]; then
- echo "$0: debug[3]: temporary sed script starts below: $TMP_SED_SCRIPT" 1>&2
- echo "$TMP_SED_SCRIPT" 1>&2
- echo "$0: debug[3]: temporary sed script ends above: $TMP_SED_SCRIPT" 1>&2
+ if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: temporary sed script starts below: $TMP_SED_SCRIPT" 1>&2
+ cat "$TMP_SED_SCRIPT" 1>&2
+ echo "$0: debug[5]: temporary sed script ends above: $TMP_SED_SCRIPT" 1>&2
fi
elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: because of -n, temporary sed script is not formed: $TMP_SED_SCRIPT" 1>&2
@@ -1805,23 +1975,27 @@ fi
CUR_PHASE_NUM=20
CUR_PHASE_NAME="before-tool"
#
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: B_OPTSTR: $B_OPTSTR" 1>&2
+fi
+#
if [[ -n $BEFORE_TOOL ]]; then
if [[ -z $NOOP ]]; then
# append before tool output
#
if [[ $V_FLAG -ge 5 ]]; then
- echo "$0: debug[6]: about to execute:"\
- "$BEFORE_TOOL -u $REPO_URL -U $TOP_URL $BEFORE_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR >> $TMP_INDEX_HTML" 1>&2
+ echo "$0: debug[5]: about to execute:" \
+ "$BEFORE_TOOL $B_OPTSTR -- $YEAR_DIR/$WINNER_DIR >> $TMP_INDEX_HTML" 1>&2
fi
# SC2086 (info): Double quote to prevent globbing and word splitting.
# https://www.shellcheck.net/wiki/SC2086
# shellcheck disable=SC2086
- eval "$BEFORE_TOOL" -u "$REPO_URL" -U "$TOP_URL" $BEFORE_TOOL_OPTSTR -- "$YEAR_DIR/$WINNER_DIR" >> "$TMP_INDEX_HTML"
+ eval "$BEFORE_TOOL" $B_OPTSTR -- "$YEAR_DIR/$WINNER_DIR" >> "$TMP_INDEX_HTML"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: before tool:" \
- "$BEFORE_TOOL -u $REPO_URL -U $TOP_URL $BEFORE_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR failed," \
+ "$BEFORE_TOOL $B_OPTSTR -- $YEAR_DIR/$WINNER_DIR failed," \
"error code: $status" 1>&2
exit 95
fi
@@ -1846,20 +2020,27 @@ fi
CUR_PHASE_NUM=21
CUR_PHASE_NAME="pandoc-wrapper-tool"
#
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: P_OPTSTR: $P_OPTSTR" 1>&2
+fi
+#
if [[ -n $PANDOC_WRAPPER ]]; then
if [[ -z $NOOP ]]; then
# append pandoc wrapper tool output
#
if [[ $V_FLAG -ge 5 ]]; then
- echo "$0: debug[6]: about to execute:"\
- "$PANDOC_WRAPPER -u $REPO_URL -U $TOP_URL-P $PANDOC_WRAPPER_OPTSTR -- $README_PATH - >> $TMP_INDEX_HTML" 1>&2
+ echo "$0: debug[5]: about to execute:" \
+ "$PANDOC_WRAPPER $P_OPTSTR -- $README_PATH - >> $TMP_INDEX_HTML" 1>&2
fi
- "$PANDOC_WRAPPER" -u "$REPO_URL" -U "$TOP_URL" -P "$PANDOC_WRAPPER_OPTSTR" -- "$README_PATH" - >> "$TMP_INDEX_HTML"
+ # SC2086 (info): Double quote to prevent globbing and word splitting.
+ # https://www.shellcheck.net/wiki/SC2086
+ # shellcheck disable=SC2086
+ eval "$PANDOC_WRAPPER" $P_OPTSTR -- "$README_PATH" - >> "$TMP_INDEX_HTML"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: pandoc wrapper tool:" \
- "$PANDOC_WRAPPER -u $REPO_URL -U $TOP_URL-P $PANDOC_WRAPPER_OPTSTR -- $README_PATH - failed," \
+ "$PANDOC_WRAPPER $P_OPTSTR -- $README_PATH - failed," \
"error code: $status" 1>&2
exit 100
fi
@@ -1884,23 +2065,27 @@ fi
CUR_PHASE_NUM=22
CUR_PHASE_NAME="after-tool"
#
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: A_OPTSTR: $A_OPTSTR" 1>&2
+fi
+#
if [[ -n $AFTER_TOOL ]]; then
if [[ -z $NOOP ]]; then
# append after tool output
#
if [[ $V_FLAG -ge 5 ]]; then
- echo "$0: debug[6]: about to execute:"\
- "$AFTER_TOOL -u $REPO_URL -U $TOP_URL $AFTER_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR >> $TMP_INDEX_HTML" 1>&2
+ echo "$0: debug[5]: about to execute:" \
+ "$AFTER_TOOL $A_OPTSTR $AFTER_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR >> $TMP_INDEX_HTML" 1>&2
fi
# SC2086 (info): Double quote to prevent globbing and word splitting.
# https://www.shellcheck.net/wiki/SC2086
# shellcheck disable=SC2086
- eval "$AFTER_TOOL" -u "$REPO_URL" -U "$TOP_URL" $AFTER_TOOL_OPTSTR -- "$YEAR_DIR/$WINNER_DIR" >> "$TMP_INDEX_HTML"
+ eval "$AFTER_TOOL" $A_OPTSTR $AFTER_TOOL_OPTSTR -- "$YEAR_DIR/$WINNER_DIR" >> "$TMP_INDEX_HTML"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: after tool:" \
- "$AFTER_TOOL -u $REPO_URL -U $TOP_URL $AFTER_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR failed," \
+ "$AFTER_TOOL $A_OPTSTR $AFTER_TOOL_OPTSTR -- $YEAR_DIR/$WINNER_DIR failed," \
"error code: $status" 1>&2
exit 105
fi
@@ -2058,11 +2243,18 @@ if [[ -z $NOOP ]]; then
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: mv -f -- $TMP_INDEX_HTML $INDEX_PATH" 1>&2
fi
- mv -f -- "$TMP_INDEX_HTML" "$INDEX_PATH"
- status="$?"
+ if [[ $V_FLAG -ge 3 ]]; then
+ mv -f -v -- "$TMP_INDEX_HTML" "$INDEX_PATH"
+ status="$?"
+ else
+ mv -f -- "$TMP_INDEX_HTML" "$INDEX_PATH"
+ status="$?"
+ fi
if [[ status -ne 0 ]]; then
echo "$0: ERROR: mv -f -- $TMP_INDEX_HTML $INDEX_PATH filed, error code: $status" 1>&2
exit 138
+ elif [[ $V_FLAG -ge 1 ]]; then
+ echo "$0: debug[3]: built index HTML file: $INDEX_PATH" 1>&2
fi
if [[ ! -s $INDEX_PATH ]]; then
echo "$0: ERROR: not a non-empty index HTML file: $INDEX_PATH" 1>&2
@@ -2084,11 +2276,9 @@ fi
# All Done!!! -- Jessica Noll, Age 2
#
-if [[ -z $NOOP ]]; then
+if [[ -n $NOOP ]]; then
if [[ $V_FLAG -ge 1 ]]; then
- echo "$0: debug[1]: All Done!!! -- Jessica Noll, Age 2, formed index HTML file: $INDEX_PATH" 1>&2
+ echo "$0: debug[3]: because of -n, skipped forming index HTML file: $INDEX_PATH" 1>&2
fi
-elif [[ $V_FLAG -ge 1 ]]; then
- echo "$0: debug[3]: because of -n, skipped forming index HTML file: $INDEX_PATH" 1>&2
fi
exit 0