Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annoying answers version bug #1007

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Major changes to the IOCCC entry toolkit


## Release 1.6.2 2024-10-23

Fix annoying bug where the `MKIOCCCENTRY_ANSWERS_VERSION` could not be in
`soup/version.h` and the `MKIOCCCENTRY_ANSWERS_EOF` could not be in
`mkiocccentry.h`.

Fix `write_echo()` in `test_ioccc/prep.sh` to not leave lines in the log file
that simply say `OK`.


## Release 1.6.1 2024-10-22

Sync the `jparse/` directory with state, as of 2024-10-22, of the
Expand Down
18 changes: 0 additions & 18 deletions mkiocccentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,6 @@
*/
#define REQUIRED_ARGS (4) /* number of required arguments on the command line */

/*
* Answers file constants.
*
* Version of answers file.
* Use format:
*
* MKIOCCCENTRY_ANSWERS-IOCCCMOCK-major.minor
* MKIOCCCENTRY_ANSWERS-IOCCC[0-9[0-9]-major.minor
*
* The following is NOT the version of this mkiocccentry tool!
*
* NOTE: these MUST be here and NOT in version.h or in mkiocccentry.h!
*/
#define MKIOCCCENTRY_ANSWERS_VERSION "MKIOCCCENTRY_ANSWERS_IOCCC28-1.0"
/* Answers file EOF marker */
#define MKIOCCCENTRY_ANSWERS_EOF "ANSWERS_EOF"


/*
* usage message
*
Expand Down
10 changes: 2 additions & 8 deletions mkiocccentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,12 @@
*/
#include "soup/entry_util.h"

/*
* mkiocccentry tool basename
*/
#define MKIOCCCENTRY_BASENAME "mkiocccentry"


/*
* definitions
*
* NOTE: MKIOCCCENTRY_ANSWERS_VERSION and MKIOCCCENTRY_ANSWERS_EOF must be defined
* in mkiocccentry.c and not here.
*/
#define MKIOCCCENTRY_BASENAME "mkiocccentry" /* mkiocccentry tool basename for -V/-h */
#define MKIOCCCENTRY_ANSWERS_EOF "ANSWERS_EOF" /* answers file EOF marker */
#define ISO_3166_1_CODE_URL0 "\thttps://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"
#define ISO_3166_1_CODE_URL1 "\thttps://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"
#define ISO_3166_1_CODE_URL2 "\thttps://www.iso.org/obp/ui/#iso:pub:PUB500001:en"
Expand Down
6 changes: 4 additions & 2 deletions soup/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
*
* NOTE: This should match the latest Release string in CHANGES.md
*/
#define MKIOCCCENTRY_REPO_VERSION "1.6.1 2024-10-22" /* special release format: major.minor.patch YYYY-MM-DD */
#define MKIOCCCENTRY_REPO_VERSION "1.6.2 2024-10-23" /* special release format: major.minor.patch YYYY-MM-DD */


/*
* official soup version (aka recipe :-) )
Expand All @@ -79,9 +80,10 @@
#define IOCCCSIZE_VERSION "28.15 2024-06-27" /* format: major.minor YYYY-MM-DD */

/*
* official mkiocccentry version
* official mkiocccentry versions (mkiocccentry itself and answers)
*/
#define MKIOCCCENTRY_VERSION "1.0.8 2024-08-23" /* format: major.minor YYYY-MM-DD */
#define MKIOCCCENTRY_ANSWERS_VERSION "MKIOCCCENTRY_ANSWERS_IOCCC28-1.0" /* answers file version */

/*
* Version of info for JSON the .info.json file.
Expand Down
6 changes: 3 additions & 3 deletions test_ioccc/mkiocccentry_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ EOF
}
rm -f answers.txt
# Retrieve the answers version from mkiocccentry.c and write to answers file:
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' mkiocccentry.c | cut -d' ' -f3 | sed 's/"//g' >answers.txt
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' soup/version.h | cut -d' ' -f3 | sed 's/"//g' >answers.txt
# Append answers + EOF marker
#
# We disable this shellcheck error because answers already is defined but we
Expand Down Expand Up @@ -445,7 +445,7 @@ EOF
}
rm -f answers.txt
# Retrieve the answers version from mkiocccentry.c and write to answers file:
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' mkiocccentry.c | cut -d' ' -f3 | sed 's/"//g' >answers.txt
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' soup/version.h | cut -d' ' -f3 | sed 's/"//g' >answers.txt
# Append answers + EOF marker
#
# We disable this shellcheck error because answers already is defined but we
Expand Down Expand Up @@ -531,7 +531,7 @@ EOF
}
rm -f answers.txt
# Retrieve the answers version from mkiocccentry.c and write to answers file:
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' mkiocccentry.c | cut -d' ' -f3 | sed 's/"//g' >answers.txt
grep -E '^#define MKIOCCCENTRY_ANSWERS_VERSION' soup/version.h | cut -d' ' -f3 | sed 's/"//g' >answers.txt
# Append answers + EOF marker
answers >>answers.txt

Expand Down
6 changes: 5 additions & 1 deletion test_ioccc/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ write_echo()
local MSG="$*"

if [[ -n "$LOGFILE" ]]; then
echo "$MSG" | tee -a -- "$LOGFILE"
if [[ "$MSG" != "OK" ]]; then
echo "$MSG" | tee -a -- "$LOGFILE"
else
echo "$MSG"
fi
else
echo "$MSG" 1>&2
fi
Expand Down